[Feature] add docs with NPU backend (#9333)

* update npu doc

* add ssdlite_mbv2 result

* update url
pull/9435/head
wangjiangben-hw 3 years ago committed by GitHub
parent 2c82b7ed1b
commit 5fb38fa4fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      configs/retinanet/retinanet_r50_fpn_fp16_1x_coco.py
  2. 9
      configs/ssd/ssd512_fp16_coco.py
  3. 35
      docs/en/device/npu.md
  4. 6
      docs/en/index.rst

@ -1,3 +1,7 @@
_base_ = './retinanet_r50_fpn_1x_coco.py'
# fp16 settings
fp16 = dict(loss_scale=512.)
# set grad_norm for stability during mixed-precision training
optimizer_config = dict(
_delete_=True, grad_clip=dict(max_norm=35, norm_type=2))

@ -0,0 +1,9 @@
_base_ = ['./ssd512_coco.py']
# fp16 settings
fp16 = dict(loss_scale='dynamic')
# learning policy
# In order to avoid non-convergence in the early stage of
# mixed-precision training, the warmup in the lr_config is set to linear,
# warmup_iters increases and warmup_ratio decreases.
lr_config = dict(warmup='linear', warmup_iters=1000, warmup_ratio=1.0 / 10)

@ -0,0 +1,35 @@
# NPU (HUAWEI Ascend)
## 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.
Here we use 8 NPUs on your computer to train the model with the following command:
```shell
bash tools/dist_train.sh configs/ssd/ssd300_coco.py 8
```
Also, you can use only one NPU to train the model with the following command:
```shell
python tools/train.py configs/ssd/ssd300_coco.py
```
## Verified Models
| 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-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) |
| [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.
**All above models are provided by Huawei Ascend group.**

@ -50,6 +50,12 @@ Welcome to MMDetection's documentation!
api.rst
.. toctree::
:maxdepth: 1
:caption: Device Support
device/npu.md
Indices and tables
==================

Loading…
Cancel
Save