Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] update npu doc #9535

Merged
merged 18 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions docs/en/device/npu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Usage

Please refer to [link](https://github.com/open-mmlab/mmcv/blob/master/docs/zh_cn/get_started/build.md) installing mmcv on NPU Devices.
Please refer to [link](https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-mmcv-full-on-ascend-npu-machine) installing mmcv
on NPU Devices.
wangjiangben-hw marked this conversation as resolved.
Show resolved Hide resolved

Here we use 8 NPUs on your computer to train the model with the following command:

Expand All @@ -16,20 +17,29 @@ Also, you can use only one NPU to train the model with the following command:
python tools/train.py configs/ssd/ssd300_coco.py
```

## Verified Models
## Models Results

| Model | box AP | mask AP | Config | Download |
| :------------------: | :----: | :-----: | :---------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- |
| [ssd300](<>) | 25.6 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssd300_fp16_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssd300_coco.log.json) |
| [ssd512](<>) | 29.4 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssd512_fp16_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssd512_coco.log.json) |
| [\*ssdlite-mbv2](<>) | 20.2 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssdlite_mobilenetv2_scratch_600e_coco.log.json) |
| [ssdlite-mbv2\*](<>) | 20.2 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssdlite_mobilenetv2_scratch_600e_coco.log.json) |
| [retinanet-r18](<>) | 31.8 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/retinanet/retinanet_r18_fpn_1x8_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/retinanet_r18_fpn_1x8_1x_coco.log.json) |
| [retinanet-r50](<>) | 36.6 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/retinanet/retinanet_r50_fpn_fp16_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/retinanet_r50_fpn_1x_coco.log.json) |
| [\*fcos-r50](<>) | 36.1 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos/fcos_r50_caffe_fpn_gn-head_fp16_1x_bs8x8_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/fcos_r50_caffe_fpn_gn-head_1x_coco_bs8x8.log.json) |
| [yolov3-608](<>) | 34.7 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/yolo/yolov3_d53_fp16_mstrain-608_273e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/yolov3_d53_fp16_mstrain-608_273e_coco.log.json) |
| [yolox-s\*\*](<>) | 39.9 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/yolox/yolox_s_8x8_300e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/yolox_s_8x8_300e_coco.log.json) |
| [centernet-r18](<>) | 26.1 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/centernet/centernet_resnet18_140e_cocoo.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/centernet_resnet18_140e_coco.log.jsonn) |
| [fcos-r50\*](<>) | 36.1 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos/fcos_r50_caffe_fpn_gn-head_fp16_1x_bs8x8_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/fcos_r50_caffe_fpn_gn-head_1x_coco_bs8x8.log.json) |
| [solov2-r50](<>) | --- | 34.7 | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/solov2/solov2_r50_fpn_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/solov2_r50_fpn_1x_coco.log.json) |

**Notes:**

- If not specially marked, the results are same between results on the NPU and results on the GPU with FP32.
- (\*) The results on the NPU of these models are aligned with the results of the mixed-precision training on the GPU, but are lower than the results of the FP32. This situation is mainly related to the phase of the model itself in mixed-precision training, users please adjust the hyperparameters to achieve the best result by self.
- If not specially marked, the results on NPU are the same as those on the GPU with FP32.
- (\*) The results on the NPU of these models are aligned with the results of the mixed-precision training on the GPU,
but are lower than the results of the FP32. This situation is mainly related to the phase of the model itself in
mixed-precision training, users may need to adjust the hyperparameters to achieve better results.
- (\*\*) The accuracy of yolox-s on the GPU in mixed precision is 40.1, with `persister_woker=True` in the data loader config by default.
There are currently some bugs on NPUs that prevent the last few epochs from running, but the accuracy is less affected and the difference can be ignored.
affected and can be ignored.
wangjiangben-hw marked this conversation as resolved.
Show resolved Hide resolved

**All above models are provided by Huawei Ascend group.**
42 changes: 42 additions & 0 deletions docs/zh_cn/device/npu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# NPU (华为 昇腾)

## 使用方法

请参考该链接 [link](https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-mmcv-full-on-ascend-npu-machine) 安装npu版本的mmcv。
wangjiangben-hw marked this conversation as resolved.
Show resolved Hide resolved

以下展示单机八卡场景的运行指令:

```shell
bash tools/dist_train.sh configs/ssd/ssd300_coco.py 8
```

以下展示单机单卡下的运行指令:

```shell
python tools/train.py configs/ssd/ssd300_coco.py
```

## 模型验证结果

| Model | box AP | mask AP | Config | Download |
| :------------------: | :----: | :-----: | :---------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- |
| [ssd300](<>) | 25.6 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssd300_fp16_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssd300_coco.log.json) |
| [ssd512](<>) | 29.4 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssd512_fp16_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssd512_coco.log.json) |
| [ssdlite-mbv2\*](<>) | 20.2 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/ssdlite_mobilenetv2_scratch_600e_coco.log.json) |
| [retinanet-r18](<>) | 31.8 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/retinanet/retinanet_r18_fpn_1x8_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/retinanet_r18_fpn_1x8_1x_coco.log.json) |
| [retinanet-r50](<>) | 36.6 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/retinanet/retinanet_r50_fpn_fp16_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/retinanet_r50_fpn_1x_coco.log.json) |
| [yolov3-608](<>) | 34.7 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/yolo/yolov3_d53_fp16_mstrain-608_273e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/yolov3_d53_fp16_mstrain-608_273e_coco.log.json) |
| [yolox-s\*\*](<>) | 39.9 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/yolox/yolox_s_8x8_300e_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/yolox_s_8x8_300e_coco.log.json) |
| [centernet-r18](<>) | 26.1 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/centernet/centernet_resnet18_140e_cocoo.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/centernet_resnet18_140e_coco.log.jsonn) |
| [fcos-r50\*](<>) | 36.1 | --- | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos/fcos_r50_caffe_fpn_gn-head_fp16_1x_bs8x8_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/fcos_r50_caffe_fpn_gn-head_1x_coco_bs8x8.log.json) |
| [solov2-r50](<>) | --- | 34.7 | [config](https://github.com/open-mmlab/mmdetection/blob/master/configs/solov2/solov2_r50_fpn_1x_coco.py) | [log](https://download.openmmlab.com/mmdetection/v2.0/npu/solov2_r50_fpn_1x_coco.log.json) |

**Notes:**

- 如果没有特别标记,NPU 上的结果与使用 FP32 的 GPU 上的结果结果相同。
- (\*) 这些模型在 NPU 上的结果与 GPU 上的混合精度训练结果一致,但低于 FP32 的结果。这种情况主要与模型本身在混合精度训练中的特点有关,
用户可以自行调整超参数来获得更高精度。
- (\*\*) GPU 上 yolox-s 在混合精度下的精度为 40.1 低于readme中 40.5 的水平;默认情况下,yolox-s 启用 persister_woker,但这个参数
wangjiangben-hw marked this conversation as resolved.
Show resolved Hide resolved
目前在NPU上存在一些bug,会导致在最后几个epoch由于资源耗尽报错退出,对整体精度影响有限可以忽略。

**All above models are provided by Huawei Ascend group.**
wangjiangben-hw marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Welcome to MMDetection's documentation!

api.rst

.. toctree::
:maxdepth: 1
:caption: 设备支持

device/npu.md


Indices and tables
==================
Expand Down