mmpretrain icon indicating copy to clipboard operation
mmpretrain copied to clipboard

[Feature]: Support mmclassification with MLU

Open Qiza-lyhm opened this issue 2 years ago • 2 comments

Motivation

Support training and distributed-training on MLU device.

Modification

Add MLUDataParallel and MLUDistributedDataParallel support to model wrapper.

Add MLU device to sync_random_seed.

BC-breaking (Optional)

Only Support MLU training with MMCV>=1.6.0.

Use cases (Optional)

It will automatically select device to train model.

Checklist

Before PR:

  • [x] Pre-commit or other linting tools are used to fix the potential lint issues.
  • [x] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • [x] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • [ ] The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • [ ] If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • [x] CLA has been signed and all committers have signed the CLA in this PR.

Qiza-lyhm avatar Jul 29 '22 07:07 Qiza-lyhm

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 29 '22 07:07 CLAassistant

Codecov Report

Base: 86.09% // Head: 85.30% // Decreases project coverage by -0.78% :warning:

Coverage data is based on head (ce07b44) compared to base (91b85bb). Patch coverage: 50.00% of modified lines in pull request are covered.

:exclamation: Current head ce07b44 differs from pull request most recent head fb7dc10. Consider uploading reports for the commit fb7dc10 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #942      +/-   ##
==========================================
- Coverage   86.09%   85.30%   -0.79%     
==========================================
  Files         142      134       -8     
  Lines        9895     8787    -1108     
  Branches     1612     1519      -93     
==========================================
- Hits         8519     7496    -1023     
+ Misses       1114     1066      -48     
+ Partials      262      225      -37     
Flag Coverage Δ
unittests 85.25% <50.00%> (-0.78%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcls/utils/distribution.py 8.00% <0.00%> (-2.53%) :arrow_down:
mmcls/datasets/builder.py 86.41% <71.42%> (-1.42%) :arrow_down:
mmcls/apis/train.py 16.45% <100.00%> (+1.07%) :arrow_up:
mmcls/datasets/samplers/distributed_sampler.py 85.18% <100.00%> (ø)
mmcls/datasets/samplers/repeat_aug.py 90.90% <100.00%> (ø)
mmcls/models/utils/helpers.py 79.16% <0.00%> (-20.84%) :arrow_down:
mmcls/models/utils/embed.py 65.33% <0.00%> (-2.96%) :arrow_down:
mmcls/models/classifiers/image.py 91.30% <0.00%> (-0.37%) :arrow_down:
mmcls/models/backbones/t2t_vit.py 95.12% <0.00%> (-0.06%) :arrow_down:
... and 19 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jul 29 '22 08:07 codecov[bot]

Hi, is this PR ready to merge? Anything I shall do here?

Qiza-lyhm avatar Sep 26 '22 09:09 Qiza-lyhm