Parcourir la source

Update device contribution docs (#3854)

* Update device contribution docs

* Add space

---------

Co-authored-by: a31413510 <31413510@qq.com>
wuzewu il y a 7 mois
Parent
commit
c22c0cd4c7

+ 25 - 17
docs/other_devices_support/how_to_contribute_device.en.md

@@ -26,39 +26,47 @@ Since PaddleX is based on the PaddlePaddle model library, after the device compl
 
 After completing the device integration into PaddlePaddle and the PaddleCV devkits, you need to update the device recognition-related code and documentation in PaddleX.
 
-## 2.1 Inference Support
+## 2.1 Code Related Issues
 
-### 2.1.1 Version Support (Optional)
+### 2.1.1 Update Whitelist Settings
 
-If the relevant device has specific requirements for the PaddlePaddle version, you can make judgments based on device information and version information during initialization. The relevant code is located in the `_check_paddle_version` function in [PaddleX Initialization](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/__init__.py).
+Since different AI computing device supports different model lists, PaddleX internally determines whether a specific model is supported on the hardware based on a whitelist. The relevant code is located in `XXX_WHITELIST` in [PaddleX Model Whitelist](../../paddlex/utils/custom_device_list.py). Please configure this list according to actual support conditions.
 
-### 2.1.2 Setting Environment Variables (Optional)
+Additionally, update the `check_supported_device_type` function in [Device Validation](../../paddlex/utils/device.py).
 
-If special environment variables need to be set when using the relevant device, you can modify the device environment setup code. The relevant code is located in the `set_env_for_device_type` function in [PaddleX Environment Variable Settings](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/utils/device.py).
+### 2.1.2 Update AI Computing Chip Support List
 
-### 2.1.3 Creating a Predictor
+Update the list of supported AI computing device in PaddleX. The relevant code is located in `SUPPORTED_DEVICE_TYPE` in [PaddleX Hardware Support List](../../paddlex/utils/device.py).
 
-PaddleX's inference capability is provided based on the Paddle Inference Predictor. When creating a Predictor, you need to select different device based on device information and create passes. The relevant code is located in the `_create` function in [PaddleX Predictor Creation](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/inference/components/paddle_predictor/predictor.py).
+### 2.1.3 Setting Environment Variables
 
-### 2.1.4 Updating the Device Support List
+If special environment variables need to be set when using the relevant device, you can modify the device environment setup code. The relevant code is located in the `set_env_for_device_type` function in [PaddleX Environment Variable Settings](../../paddlex/utils/device.py).
 
-When creating a Predictor, it will judge whether the device is already supported. The relevant code is located in the `SUPPORT_DEVICE` constant in [PaddleX Predictor Option](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/inference/utils/pp_option.py).
+### 2.1.4 Update Predictor Option Supported Device List
 
-### 2.1.5 Updating the Multi-Devices User Guide
+When creating a Predictor, the PaddleX checks whether the device is supported. The relevant code is located in `SUPPORT_DEVICE` in [PaddleX Predictor Option](../../paddlex/inference/utils/pp_option.py).
 
-Please update the PaddleX multi-devices user guide and add the newly supported device information to the documentation. Both Chinese and English versions need to be updated. The Chinese version is [PaddleX多硬件使用指南](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/multi_devices_use_guide.md), and the English version is [PaddleX Multi-Devices Usage Guide](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/multi_devices_use_guide.en.md).
+### 2.1.5 Update Predictor Creation Logic
 
-### 2.1.6 Updating the Installation Tutorial
+PaddleX's inference capability is provided based on the Paddle Inference Predictor. When creating a Predictor, you need to select different device based on device information and create passes. The relevant code is located in the `_create` function in [PaddleX Predictor Creation](../../paddlex/inference/models/common/static_infer.py).
 
-Please provide device-related installation tutorials in both Chinese and English. The Chinese version can refer to [昇腾 NPU 飞桨安装教程](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/paddlepaddle_install_NPU.md), and the English version can refer to [Ascend NPU PaddlePaddle Installation Tutorial](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/paddlepaddle_install_NPU.en.md).
+### 2.1.6 High-Performance Inference Support
 
-### 2.1.7 Updating the Model List
+TODO
 
-Please provide a list of models supported by the device in both Chinese and English. The Chinese version can refer to [PaddleX模型列表(昇腾 NPU)](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/support_list/model_list_npu.md), and the English version can refer to [PaddleX Model List (Huawei Ascend NPU)](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/support_list/model_list_npu.en.md).
+## 2.2 Documentation Related Issues
 
-## 2.2 Training Support
+### 2.2.1 Updating the Multi-Devices User Guide
 
-TODO
+Please update the PaddleX multi-devices user guide and add the newly supported device information to the documentation. Both Chinese and English versions need to be updated. The Chinese version is [PaddleX多硬件使用指南](./multi_devices_use_guide.md), and the English version is [PaddleX Multi-Devices Usage Guide](./multi_devices_use_guide.en.md).
+
+### 2.2.2 Updating the Installation Tutorial
+
+Please provide device-related installation tutorials in both Chinese and English. The Chinese version can refer to [昇腾 NPU 飞桨安装教程](./paddlepaddle_install_NPU.md), and the English version can refer to [Ascend NPU PaddlePaddle Installation Tutorial](./paddlepaddle_install_NPU.en.md).
+
+### 2.2.3 Updating the Model List
+
+Please provide a list of models supported by the device in both Chinese and English. The Chinese version can refer to [PaddleX模型列表(昇腾 NPU)](../support_list/model_list_npu.md), and the English version can refer to [PaddleX Model List (Huawei Ascend NPU)](../support_list/model_list_npu.en.md).
 
 # 3. Submitting a PR
 

+ 26 - 18
docs/other_devices_support/how_to_contribute_device.md

@@ -24,41 +24,49 @@
 
 # 2. 更新PaddleX
 
-当完成硬件接入飞桨和各个套件后,需要更新PaddleX中硬件识别相关的代码和说明文档
+当完成硬件接入飞桨和各个套件后,需要更新PaddleX中硬件识别相关的代码和说明文档,相关设备代号应该与飞桨中注册的设备代号一致,如 `npu` `xpu`
 
-## 2.1 推理能力支持
+## 2.1 代码相关
 
-### 2.1.1 版本支持(可忽略)
+### 2.1.1 更新白名单设置
 
-如果相关硬件对于飞桨版本有特定要求,可以在初始化时根据设备信息和版本信息进行判断,相关代码位于 [PaddleX初始化](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/__init__.py)中的 `_check_paddle_version`
+由于不同的AI计算硬件上支持的模型列表不一样,PaddleX内部基于白名单确定特定模型是否支持该硬件,相关代码位于 [PaddleX模型白名单](../../paddlex/utils/custom_device_list.py) 中的 `XXX_WHITELIST`,请根据实际支持情况设置该名单。
 
-### 2.1.2 设置环境变量(可忽略)
+同时需要更新 [设备判断](../../paddlex/utils/device.py) 中的 `check_supported_device_type`
 
-如果相关硬件在使用时,需要设定特殊的环境变量,可以修改设备环境设置代码,相关代码位于 [PaddleX环境变量设置](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/utils/device.py)中的 `set_env_for_device_type`
+### 2.1.2 更新AI计算芯片支持列表
 
-### 2.1.3 创建Predictor
+更新PaddleX中AI计算芯片支持列表,相关代码位于 [PaddleX硬件支持列表](../../paddlex/utils/device.py) 中的 `SUPPORTED_DEVICE_TYPE`
 
-PaddleX的推理能力基于飞桨Paddle Inference Predictor提供,创建Predictor时需要根据设备信息选择不同的硬件并创建pass,相关代码位于[PaddleX Predictor创建](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/inference/components/paddle_predictor/predictor.py)的 `_create`
+### 2.1.3 设置环境变量
 
-### 2.1.4 更新硬件支持列表
+如果相关硬件在使用时,需要设定特殊的环境变量,可以修改设备环境设置代码,相关代码位于 [PaddleX环境变量设置](../../paddlex/utils/device.py) 中的 `set_env_for_device_type`
 
-创建Predictor时会判断设备是否已支持,相关代码位于[PaddleX Predictor Option](https://github.com/PaddlePaddle/PaddleX/blob/develop/paddlex/inference/utils/pp_option.py)中的 `SUPPORT_DEVICE`
+### 2.1.4 更新Predictor Opiton支持的设备列表
 
-### 2.1.5 更新多硬件说明指南
+PaddleX创建Predictor时会判断设备是否已支持,相关代码位于 [PaddleX Predictor Opiton](../../paddlex/inference/utils/pp_option.py) 中的 `SUPPORT_DEVICE`
 
-请更新PaddleX多硬件说明指南,将新支持的硬件信息更新到文档中,需要同时更新中英文版本,中文版本 [PaddleX多硬件使用指南](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/multi_devices_use_guide.md) ,英文版本 [PaddleX Multi-Hardware Usage Guide](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/multi_devices_use_guide.en.md)
+### 2.1.5 更新Predictor Opiton支持的设备列表
 
-### 2.1.6 更新安装教程
+PaddleX的推理能力基于飞桨Paddle Inference Predictor提供,创建Predictor时需要根据设备信息选择不同的硬件并创建pass,相关代码位于 [PaddleX Predictor创建](../../paddlex/inference/models/common/static_infer.py) 中的 `_create`
 
-请提供硬件相关的安装教程,需要提供中英文版本,中文版本参考 [昇腾 NPU 飞桨安装教程](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/paddlepaddle_install_NPU.md) ,英文版本参考 [Ascend NPU PaddlePaddle Installation Tutorial](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/other_devices_support/paddlepaddle_install_NPU.en.md)
+### 2.1.6 高性能推理支持
 
-### 2.1.7 更新模型列表
+TODO
 
-请提供硬件支持的模型列表,需要提供中英文版本,中文版本参考 [PaddleX模型列表(昇腾 NPU)](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/support_list/model_list_npu.md) ,英文版本参考 [PaddleX Model List (Huawei Ascend NPU)](https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/support_list/model_list_npu.en.md)
+## 2.2 文档相关
 
-## 2.2 训练能力支持
+### 2.2.1 更新多硬件说明指南
 
-TODO
+请更新PaddleX多硬件说明指南,将新支持的硬件信息更新到文档中,需要同时更新中英文版本,中文版本 [PaddleX多硬件使用指南](./multi_devices_use_guide.md) ,英文版本 [PaddleX Multi-Hardware Usage Guide](./multi_devices_use_guide.en.md)
+
+### 2.2.2 更新安装教程
+
+请提供硬件相关的安装教程,需要提供中英文版本,中文版本参考 [昇腾 NPU 飞桨安装教程](./paddlepaddle_install_NPU.md) ,英文版本参考 [Ascend NPU PaddlePaddle Installation Tutorial](./paddlepaddle_install_NPU.en.md)
+
+### 2.2.3 更新模型列表
+
+请提供硬件支持的模型列表,需要提供中英文版本,中文版本参考 [PaddleX模型列表(昇腾 NPU)](../support_list/model_list_npu.md) ,英文版本参考 [PaddleX Model List (Huawei Ascend NPU)](../support_list/model_list_npu.en.md)
 
 # 3. 提交PR