Selaa lähdekoodia

update mlu/xpu model list (#1941)

a31413510 1 vuosi sitten
vanhempi
commit
2a3f4be8b4

+ 2 - 2
docs/tutorials/INSTALL_OTHER_DEVICES.md

@@ -67,8 +67,8 @@ docker run -it --name paddle-mlu-dev -v $(pwd):/work \
 - 1. 下载安装 Python3.10 的wheel 安装包。
 ```
 # 注意需要先安装飞桨 cpu 版本
-pip install https://paddle-whl.bj.bcebos.com/paddlex/mlu/paddlepaddle-3.0.0.dev20240621-cp310-cp310-linux_x86_64.whl
-pip install https://paddle-whl.bj.bcebos.com/paddlex/mlu/paddle_custom_mlu-3.0.0.dev20240621-cp310-cp310-linux_x86_64.whl
+python -m pip install paddlepaddle==3.0.0.dev20240624 -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
+python -m pip install paddle-custom-mlu==3.0.0.dev20240806 -i https://www.paddlepaddle.org.cn/packages/nightly/mlu/
 ```
 - 2. 验证安装包
 安装完成之后,运行如下命令。

+ 1 - 1
docs/tutorials/base/devices_use_guidance.md

@@ -54,5 +54,5 @@ paddlex --install
 
 ## 2、PaddleX 使用
 
-PaddleX 模型训练/评估/推理的详细使用方法,参考文档:[模型训练/评估/推理](./README.md)
+PaddleX 模型训练/评估/推理的详细使用方法,参考文档:[PaddleX 单模型开发工具](../models/model_develop_tools.md)
 在具体设备上,根据所属硬件平台,添加配置设备的参数,即可在对应硬件上使用上述工具。

+ 41 - 2
docs/tutorials/models/support_mlu_model_list.md

@@ -1,4 +1,4 @@
-# PaddleX模型列表
+# PaddleX模型列表(寒武纪)
 
 ## 一、图像分类
 ### 1. ResNet系列
@@ -38,7 +38,46 @@
 | :--- | :---: |
 | PP-HGNet_small | [PP-HGNet_small.yaml](../../../paddlex/configs/image_classification/PP-HGNet_small.yaml)|
 
-## 二、时序预测
+## 二、目标检测
+### 1. PP-YOLOE_plus系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-YOLOE_plus-S | [PP-YOLOE_plus-S.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-S.yaml)|
+| PP-YOLOE_plus-M | [PP-YOLOE_plus-M.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-M.yaml)|
+| PP-YOLOE_plus-L | [PP-YOLOE_plus-L.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-L.yaml)|
+| PP-YOLOE_plus-X | [PP-YOLOE_plus-X.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-X.yaml)|
+### 2. PicoDet系列
+| 模型名称 | config |
+| :--- | :---: |
+| PicoDet-S | [PicoDet-S.yaml](../../../paddlex/configs/object_detection/PicoDet-S.yaml)|
+| PicoDet-L | [PicoDet-L.yaml](../../../paddlex/configs/object_detection/PicoDet-L.yaml)|
+
+## 三、语义分割
+### 1.PP-LiteSeg系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-LiteSeg-T | [PP-LiteSeg-T.yaml](../../../paddlex/configs/semantic_segmentation/PP-LiteSeg-T.yaml)|
+
+## 四、文本检测
+### 1.PP-OCRv4 系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-OCRv4_server_det | [PP-OCRv4_server_det.yaml](../../../paddlex/configs/text_detection/PP-OCRv4_server_det.yaml)|
+| PP-OCRv4_mobile_det | [PP-OCRv4_mobile_det.yaml](../../../paddlex/configs/text_detection/PP-OCRv4_mobile_det.yaml)|
+
+## 五、文本识别
+### 1.PP-OCRv4 系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-OCRv4_server_rec | [PP-OCRv4_server_rec.yaml](../../../paddlex/configs/text_recognition/PP-OCRv4_server_rec.yaml)|
+| PP-OCRv4_mobile_rec | [PP-OCRv4_mobile_rec.yaml](../../../paddlex/configs/text_recognition/PP-OCRv4_mobile_rec.yaml)|
+
+## 六、版面分析
+| 模型名称 | config |
+| :--- | :---: |
+| PicoDet_layout_1x | [PicoDet_layout_1x.yaml](../../../paddlex/configs/structure_analysis/PicoDet_layout_1x.yaml)|
+
+## 七、时序预测
 | 模型名称 | config |
 | :--- | :---: |
 | DLinear | [DLinear.yaml](../../../paddlex/configs/ts_forecast/DLinear.yaml)|

+ 1 - 1
docs/tutorials/models/support_npu_model_list.md

@@ -1,4 +1,4 @@
-# PaddleX模型列表
+# PaddleX模型列表(昇腾)
 
 ## 一、图像分类
 ### 1. ResNet系列

+ 51 - 4
docs/tutorials/models/support_xpu_model_list.md

@@ -1,4 +1,4 @@
-# PaddleX模型列表
+# PaddleX模型列表(昆仑)
 
 ## 一、图像分类
 ### 1. ResNet系列
@@ -20,17 +20,64 @@
 | PP-LCNet_x1_5 | [PP-LCNet_x1_5.yaml](../../../paddlex/configs/image_classification/PP-LCNet_x1_5.yaml)|
 | PP-LCNet_x2_0 | [PP-LCNet_x2_0.yaml](../../../paddlex/configs/image_classification/PP-LCNet_x2_0.yaml)|
 | PP-LCNet_x2_5 | [PP-LCNet_x2_5.yaml](../../../paddlex/configs/image_classification/PP-LCNet_x2_5.yaml)|
-### 3.PP-HGNet系列
+### 3.MobileNetV3系列
+| 模型名称 | config |
+| :--- | :---: |
+| MobileNetV3_small_x0_35 | [MobileNetV3_small_x0_35.yaml](../../../paddlex/configs/image_classification/MobileNetV3_small_x0_35.yaml)|
+| MobileNetV3_small_x0_5 | [MobileNetV3_small_x0_5.yaml](../../../paddlex/configs/image_classification/MobileNetV3_small_x0_5.yaml)|
+| MobileNetV3_small_x0_75 | [MobileNetV3_small_x0_75.yaml](../../../paddlex/configs/image_classification/MobileNetV3_small_x0_75.yaml)|
+| MobileNetV3_small_x1_0 | [MobileNetV3_small_x1_0.yaml](../../../paddlex/configs/image_classification/MobileNetV3_small_x1_0.yaml)|
+| MobileNetV3_small_x1_25 | [MobileNetV3_small_x1_25.yaml](../../../paddlex/configs/image_classification/MobileNetV3_small_x1_25.yaml)|
+| MobileNetV3_large_x0_35 | [MobileNetV3_large_x0_35.yaml](../../../paddlex/configs/image_classification/MobileNetV3_large_x0_35.yaml)|
+| MobileNetV3_large_x0_5 | [MobileNetV3_large_x0_5.yaml](../../../paddlex/configs/image_classification/MobileNetV3_large_x0_5.yaml)|
+| MobileNetV3_large_x0_75 | [MobileNetV3_large_x0_75.yaml](../../../paddlex/configs/image_classification/MobileNetV3_large_x0_75.yaml)|
+| MobileNetV3_large_x1_0 | [MobileNetV3_large_x1_0.yaml](../../../paddlex/configs/image_classification/MobileNetV3_large_x1_0.yaml)|
+| MobileNetV3_large_x1_25 | [MobileNetV3_large_x1_25.yaml](../../../paddlex/configs/image_classification/MobileNetV3_large_x1_25.yaml)|
+### 4.PP-HGNet系列
 | 模型名称 | config |
 | :--- | :---: |
 | PP-HGNet_small | [PP-HGNet_small.yaml](../../../paddlex/configs/image_classification/PP-HGNet_small.yaml)|
 
-## 二、版面分析
+## 二、目标检测
+### 1. PP-YOLOE_plus系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-YOLOE_plus-S | [PP-YOLOE_plus-S.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-S.yaml)|
+| PP-YOLOE_plus-M | [PP-YOLOE_plus-M.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-M.yaml)|
+| PP-YOLOE_plus-L | [PP-YOLOE_plus-L.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-L.yaml)|
+| PP-YOLOE_plus-X | [PP-YOLOE_plus-X.yaml](../../../paddlex/configs/object_detection/PP-YOLOE_plus-X.yaml)|
+### 2. PicoDet系列
+| 模型名称 | config |
+| :--- | :---: |
+| PicoDet-S | [PicoDet-S.yaml](../../../paddlex/configs/object_detection/PicoDet-S.yaml)|
+| PicoDet-L | [PicoDet-L.yaml](../../../paddlex/configs/object_detection/PicoDet-L.yaml)|
+
+## 三、语义分割
+### 1.PP-LiteSeg系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-LiteSeg-T | [PP-LiteSeg-T.yaml](../../../paddlex/configs/semantic_segmentation/PP-LiteSeg-T.yaml)|
+
+## 四、文本检测
+### 1.PP-OCRv4 系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-OCRv4_server_det | [PP-OCRv4_server_det.yaml](../../../paddlex/configs/text_detection/PP-OCRv4_server_det.yaml)|
+| PP-OCRv4_mobile_det | [PP-OCRv4_mobile_det.yaml](../../../paddlex/configs/text_detection/PP-OCRv4_mobile_det.yaml)|
+
+## 五、文本识别
+### 1.PP-OCRv4 系列
+| 模型名称 | config |
+| :--- | :---: |
+| PP-OCRv4_server_rec | [PP-OCRv4_server_rec.yaml](../../../paddlex/configs/text_recognition/PP-OCRv4_server_rec.yaml)|
+| PP-OCRv4_mobile_rec | [PP-OCRv4_mobile_rec.yaml](../../../paddlex/configs/text_recognition/PP-OCRv4_mobile_rec.yaml)|
+
+## 六、版面分析
 | 模型名称 | config |
 | :--- | :---: |
 | PicoDet_layout_1x | [PicoDet_layout_1x.yaml](../../../paddlex/configs/structure_analysis/PicoDet_layout_1x.yaml)|
 
-## 三、时序预测
+## 、时序预测
 | 模型名称 | config |
 | :--- | :---: |
 | DLinear | [DLinear.yaml](../../../paddlex/configs/ts_forecast/DLinear.yaml)|

+ 6 - 1
paddlex/modules/base/predictor/utils/paddle_inference_predictor.py

@@ -49,10 +49,15 @@ self._create(model_dir, model_prefix, option, delete_pass=delete_pass)
             os.environ["FLAGS_allocator_strategy"] = "auto_growth"
             os.environ[
                 "CUSTOM_DEVICE_BLACK_LIST"] = "pad3d,pad3d_grad,set_value,set_value_with_tensor"
+            os.environ["FLAGS_npu_scale_aclnn"] = "True"
+            os.environ["FLAGS_npu_split_aclnn"] = "True"
         elif option.device == 'xpu':
-            config.enable_custom_device('npu')
+            os.environ["BKCL_FORCE_SYNC"] = "1"
+            os.environ["BKCL_TIMEOUT"] = "1800"
+            os.environ["FLAGS_use_stride_kernel"] = "0"
         elif option.device == 'mlu':
             config.enable_custom_device('mlu')
+            os.environ["FLAGS_use_stride_kernel"] = "0"
         else:
             assert option.device == 'cpu'
             config.disable_gpu()

+ 8 - 2
paddlex/utils/device.py

@@ -12,8 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-
 import os
 import paddle
 from .errors import raise_unsupported_device_error
@@ -35,6 +33,14 @@ def get_device(device_cfg, using_device_number=None):
             os.environ["FLAGS_allocator_strategy"] = "auto_growth"
             os.environ[
                 "CUSTOM_DEVICE_BLACK_LIST"] = "pad3d,pad3d_grad,set_value,set_value_with_tensor"
+            os.environ["FLAGS_npu_scale_aclnn"] = "True"
+            os.environ["FLAGS_npu_split_aclnn"] = "True"
+        if device.lower() == "xpu":
+            os.environ["BKCL_FORCE_SYNC"] = "1"
+            os.environ["BKCL_TIMEOUT"] = "1800"
+            os.environ["FLAGS_use_stride_kernel"] = "0"
+        if device.lower() == "mlu":
+            os.environ["FLAGS_use_stride_kernel"] = "0"
 
         if len(device_cfg.split(":")) == 2:
             device_ids = device_cfg.split(":")[1]