Skip to content

[feature] add A Comprehensive Overhaul of Feature Distillation#244

Merged
sunnyxiaohu merged 14 commits intoopen-mmlab:dev-1.xfrom
fpshuang:ofd
Aug 29, 2022
Merged

[feature] add A Comprehensive Overhaul of Feature Distillation#244
sunnyxiaohu merged 14 commits intoopen-mmlab:dev-1.xfrom
fpshuang:ofd

Conversation

@fpshuang
Copy link
Copy Markdown
Contributor

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Add OFD A Comprehensive Overhaul of Feature Distillation, a KD algo

Modification

  • add OFD components
  • a OFD experiment on CIFAR10
  • comprehensive UTs

BC-breaking (Optional)

Does the modification introduce changes that break the backward compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here and update the documentation.

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit tests 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.
  • CLA has been signed and all committers have signed the CLA in this PR.

huangpengsheng added 2 commits August 23, 2022 18:25
@fpshuang fpshuang changed the title Ofd WIP: [feature] add A Comprehensive Overhaul of Feature Distillation Aug 23, 2022
@fpshuang fpshuang marked this pull request as draft August 23, 2022 13:28
@fpshuang fpshuang changed the base branch from master to dev-1.x August 23, 2022 13:29
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 23, 2022

Codecov Report

Merging #244 (7550f1c) into dev-1.x (1c0da58) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head 7550f1c differs from pull request most recent head 1c2ca44. Consider uploading reports for the commit 1c2ca44 to get more accurate results

@@            Coverage Diff             @@
##           dev-1.x    #244      +/-   ##
==========================================
- Coverage     0.43%   0.42%   -0.01%     
==========================================
  Files          167     168       +1     
  Lines         6700    6776      +76     
  Branches      1081    1102      +21     
==========================================
  Hits            29      29              
- Misses        6666    6742      +76     
  Partials         5       5              
Flag Coverage Δ
unittests 0.42% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
mmrazor/models/algorithms/__init__.py 0.00% <ø> (ø)
mmrazor/models/algorithms/distill/__init__.py 0.00% <ø> (ø)
...models/algorithms/distill/configurable/__init__.py 0.00% <0.00%> (ø)
...till/configurable/overhaul_feature_distillation.py 0.00% <0.00%> (ø)
mmrazor/models/architectures/backbones/__init__.py 0.00% <0.00%> (ø)
...razor/models/architectures/backbones/wideresnet.py 0.00% <0.00%> (ø)
...mrazor/models/architectures/connectors/__init__.py 0.00% <0.00%> (ø)
...r/models/architectures/connectors/ofd_connector.py 0.00% <0.00%> (ø)
mmrazor/models/distillers/__init__.py 0.00% <0.00%> (ø)
mmrazor/models/distillers/ofd_distiller.py 0.00% <0.00%> (ø)
... and 9 more

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

@fpshuang fpshuang marked this pull request as ready for review August 24, 2022 15:22
@@ -0,0 +1,160 @@
# A Comprehensive Overhaul of Feature Distillation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme needs to update



@MODELS.register_module()
class OverhaulFeatureDistillation(SingleTeacherDistill):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring



@MODELS.register_module()
class WideResNet(BaseModule):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this module requires UT?



@MODELS.register_module()
class OFDDistiller(ConfigurableDistiller):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UT and docstring



@MODELS.register_module()
class OFDLoss(nn.Module):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UT

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@wilxy
Copy link
Copy Markdown
Contributor

wilxy commented Aug 25, 2022

It's ok to me when UT and docstring are added.

@fpshuang fpshuang changed the title WIP: [feature] add A Comprehensive Overhaul of Feature Distillation [feature] add A Comprehensive Overhaul of Feature Distillation Aug 26, 2022
@sunnyxiaohu sunnyxiaohu merged commit 5d9fcd8 into open-mmlab:dev-1.x Aug 29, 2022
humu789 pushed a commit to humu789/mmrazor that referenced this pull request Feb 13, 2023
…n-mmlab#244)

* Add sort-data arg to test.py

* Set is_sort_dataset to True.

* Add a check for the possibility of sorting.

* lint

* Added mmdeploy.utils.dataset.

* Add unit test

Co-authored-by: SingleZombie <singlezombie@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants