* support unroll in darts
* fix bugs in optimizer; add docstring
* update darts algorithm [untested]
* modify autograd.grad to optim_wrapper.backward
* add amp in train.py; support constructor
* rename mmcls.data to mmcls.structures
* modify darts algo to support apex [not done]
* fix code spell in diff_mutable_module
* modify optim_context of dartsddp
* add testcase for dartsddp
* fix bugs of apex in dartsddp
* standardized the unittest of darts
* adapt new data_preprocessor
* fix ut bugs
* remove unness code
Co-authored-by: gaoyang07 <1546308416@qq.com>
* fix ci for circle ci
* fix bug in test_metafiles
* add pr_stage_test for github ci
* add multiple version
* fix ut
* fix lint
* Temporarily skip dataset UT
* update github ci
* add github lint ci
* install wheel
* remove timm from requirements
* install wheel when test on windows
* fix error
* fix bug
* remove github windows ci
* fix device error of arch_params when DsnasDDP
* fix CRD dataset ut
* fix scope error
* rm test_cuda in workflows of github
* [Doc] fix typos in en/usr_guides
Co-authored-by: liukai <liukai@pjlab.org.cn>
Co-authored-by: pppppM <gjf_mail@126.com>
Co-authored-by: gaoyang07 <1546308416@qq.com>
Co-authored-by: huangpengsheng <huangpengsheng@sensetime.com>
Co-authored-by: SheffieldCao <1751899@tongji.edu.cn>
* [tmp] Update Dsnas
* [tmp] refactor arch_loss & flops_loss
* Update Dsnas & MMRAZOR_EVALUATOR:
1. finalized compute_loss & handle_grads in algorithm;
2. add MMRAZOR_EVALUATOR;
3. fix bugs.
* Update lr scheduler & fix a bug:
1. update param_scheduler & lr_scheduler for dsnas;
2. fix a bug of switching to finetune stage.
* remove old evaluators
* remove old evaluators
* update param_scheduler config
* merge dev-1.x into gy/estimator
* add flops_loss in Dsnas using ResourcesEstimator
* get resources before mutator.prepare_from_supernet
* delete unness broadcast api from gml
* broadcast spec_modules_resources when estimating
* update early fix mechanism for Dsnas
* fix merge
* update units in estimator
* minor change
* fix data_preprocessor api
* add flops_loss_coef
* remove DsnasOptimWrapper
* fix bn eps and data_preprocessor
* fix bn weight decay bug
* add betas for mutator optimizer
* set diff_rank_seed=True for dsnas
* fix start_factor of lr when warm up
* remove .module in non-ddp mode
* add GlobalAveragePoolingWithDropout
* add UT for dsnas
* remove unness channel adjustment for shufflenetv2
* update supernet configs
* delete unness dropout
* delete unness part with minor change on dsnas
* minor change on the flag of search stage
* update README and subnet configs
* add UT for OneHotMutableOP
* update benchmark test
* fix circle ci gpu config
* move delivery, recorder, tracer from structures to task modules
* move ops from models to models.architectures
* rename dynamic_op to dynamic_ops
* fix configs and metafiles
* remove some github ci
* fix configs / readme / metafile
Co-authored-by: gaojianfei <gaojianfei@sensetime.com>
* fix name of mmcv-full to mmcv
* [doc] move the location of nas/kd/pruning; fix lint errors
* optimize docs and fix pre-commit error
* [Doc&Fix] add note for installation; fix the requirements
* update docs
Co-authored-by: humu789 <humu@pjlab.org.cn>
* [doc] add doc of installation, kd, nas, pruning
* [doc] add user guide part
* fix name of mmcv-full to mmcv
* [doc] fix mmcv based on zaida 's suggestion
* [doc] fix index error based on shiguang's comments
* 1.Add FBKD
* 1.Add torch_connector and its ut. 2.Revise readme and fbkd config.
* 1.Revise UT for torch_connectors
* 1.Revise nonlocalblock into a subclass of NonLocal2d in mmcv.cnn
* 1.Add ZSKT algorithm with zskt_generator, at_loss. 2.Add teacher_detach in kl_divergence.
* 1.Amend readme. 2.Revise UT bugs of test_graph and test_distill.
* 1.Amend docstring of zskt_generator
* 1.Add torch version judgment in test_distillation_loss.
* 1.Revise defaults of batch_size to 1 in generators. 2.Revise mmcls.data to mmcls.structures
* 1.Rename function "at" to "calc_attention_matrix".
* Refactor ModelEstimator:
1. add EvaluatorLoop in engine.runners;
2. add estimator for structures (both subnet & supernet);
3. add layer_counter for each op.
* fix lint
* update estimator:
1. add ResourceEstimator based on BaseEstimator;
2. add notes & examples for ResourceEstimator & EvaluatorLoop usage;
3. fix a bug of latency test.
4. minor changes according to comments.
* add UT & fix a bug caused by UT
* add docstrings & remove old estimator
* update docstrings for op_spec_counters
* rename resource_evaluator_val_loop
* support adding resource attrs of each submodule in a measured model
* fix lint
* refactor estimator file structures
* support estimating resources for spec modules
* rm old UT
* update new estimator UT cases
* fix traversal range of the model
* cancel unit convert in accumulate_sub_module_flops_params
* use estimator_cfg to build ResourceEstimator
* fix a broadcast bug
* delete fixed input_shape
* add assertion and string-format-return when measuring spec_modules
* add UT for estimating spec_modules
* 1.Add DAFL, including config, DAFLLoss and readme. 2.Add DataFreeDistillationtillation. 3.Add Generator, including base_generator and dafl_generator. 4.Add get_module_device and set_requires_grad functions in utils.
* 1.Amend the file that report error in mypy test under py37, including gather_tensors, datafree_distillation, base_generator. 2.Revise other linting error.
* 1.Revise some docstrings.
* 1.Add UT for datafreedistillation. 2.Add all typing.hints.
* 1.Add UT for generators and gather_tensors.
* 1.Add assert of batch_size in base_generator
* 1.Isort
Co-authored-by: zhangzhongyu.vendor < zhangzhongyu.vendor@sensetime.com>
* add BaseNode/BaseGraph, ModuleNode/ModuleGraph
* add docstring, redesign some functions
* add 'placeholder' after cat/bind/pass
* change type to a property from a method
* add test model s
* rename XXXNode in path to PathXXXNode
* 'xxconv' -> 'xxconv2d' in type
* ToGraph -> GraphConverter, PathToGraph -> PathToGraphConverter
* rm init_from_path_list
* convert some public methods to private methods in GraphConverter
* type -> basic_type
* fix some error
Co-authored-by: liukai <liukai@pjlab.org.cn>
* add dynamic bricks
* add dynamic conv2d test
* add tests for dynamic linear and dynamic norm
* add docstring for dynamic conv2d
* add docstring for dynamic linear
* add docstring for dynamic batchnorm
* Refactor the dynamic op ( put more logic into the mixin )
* fix UT
* Fix UT ( fileio was moved to mmengine)
* derived mutable adds choices property
* Unify the register interface of mutable in dynamic op
* Unified getter interface of mutable in dynamic op
Co-authored-by: gaojianfei <gaojianfei@sensetime.com>
Co-authored-by: pppppM <gjf_mail@126.com>
* fix lint
* complement unittest for derived mutable
* add docstring for derived mutable
* add unittest for mutable value
* fix logger error
* fix according to comments
* not dump derived mutable when export
* add warning in `export_fix_subnet`
* fix __mul__ in mutable value
* move build_arch_param from mutable to mutator
* fix UT of diff mutable and mutator
* modify based on shiguang's comments
* remove mutator from the unittest of mutable