mmrazor/docs/en/get_started/overview.md
pppppM 5105489d64
Revert "[Enhancement] Add benchmark test script" (#263)
Revert "[Enhancement] Add benchmark test script (#262)"

This reverts commit f60cf9c469c1365cb8e1dd62aabb6e2937e1cffa.
2022-08-30 22:03:54 +08:00

6.2 KiB
Raw Blame History

Overview

Why MMRazor

MMRazor is a model compression toolkit for model slimming, which includes 4 mainstream technologies:

  • Neural Architecture Search (NAS)
  • Pruning
  • Knowledge Distillation (KD)
  • Quantization (come soon)

It is a part of the OpenMMLab project. If you want to use it now, please refer to Get Started.

Major features:

  • Compatibility

MMRazor can be easily applied to various projects in OpenMMLab, due to the similar architecture design of OpenMMLab as well as the decoupling of slimming algorithms and vision tasks.

  • Flexibility

Different algorithms, e.g., NAS, pruning and KD, can be incorporated in a plug-n-play manner to build a more powerful system.

  • Convenience

With better modular design, developers can implement new model compression algorithms with only a few codes, or even by simply modifying config files.

Design and Implement

overview - design and implement

Design

There are 3 layers (Application / Algorithm / Component) in overview design. MMRazor mainly includes both of Component and Algorithm, while Application consist of some OpenMMLab upstream repos, such as MMClassification, MMDetection, MMSegmentation and so on.

Component provides many useful functions for quickly implementing Algorithm. And thanks to OpenMMLab 's powerful and highly flexible config mode and registry mechanism**, Algorithm** can be conveniently applied to Application.

How to apply our lightweight algorithms to some upstream tasks? Please refer to the below.

Implement

In OpenMMLab, implementing vision tasks commonly includes 3 parts (model / dataset / schedule). And just like that, implementing lightweight model also includes 3 parts (algorithm / dataset / schedule) in MMRazor.

Algorithm consist of architecture and components.

Architecture is similar to model of the upstream repos. You can chose to directly use the original model or customize the new model as your architecture according to different tasks. For example, you can directly use ResNet-34 and ResNet-18 of MMClassification to implement some KD algorithms, but in NAS, you may need to customize a searchable model.

Compone``n``ts consist of various special functions for supporting different lightweight algorithms. They can be directly used in config because of registered into MMEngine. Thus, you can pick some components you need to quickly implement your algorithm. For example, you may need mutator / mutable / searchle backbone if you want to implement a NAS algorithm, and you can pick from distill loss / recorder / delivery / connector if you need a KD algorithm.

Please refer to the next section for more details about Implement.

The arg name of algorithm in config is model rather than algorithm in order to get better supports of MMCV and MMEngine.

Key concepts

For better understanding and using MMRazor, it is highly recommended to read the following user documents according to your own needs.

Global

NAS & Pruning

KD

User guide

We provide more complete and systematic guide documents for different technical directions. It is highly recommended to read them if you want to use and customize lightweight algorithms better.

  • Neural Architecture Search (to add link)
  • Pruning (to add link)
  • Knowledge Distillation (to add link)
  • Quantization (to add link)

Tutorials

We provide the following general tutorials according to some typical requirements. If you want to further use MMRazor, you can refer to our source code and API Reference.

Tutorial list

F&Q

If you encounter some trouble using MMRazor, you can find whether your question has existed in F&Qto add link. If not existed, welcome to open a Github issue for getting support, we will reply it as soon.

Get support and contribute back

MMRazor is maintained on the MMRazor Github repository. We collect feedback and new proposals/ideas on Github. You can: