Commit Graph

615 Commits (8370c1e7f7a2b22f8f82b92d56a02b828aec4942)
 

Author SHA1 Message Date
Weihang Xia 8370c1e7f7
[Enhance] Make sure Tensors to broadcast is contiguous (#948)
* Make sure Tensors to cast is contiguous

* simplify

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-22 11:41:06 +08:00
Qian Zhao e271454527
[Fix] Temporarily fix collect_env raises errors and stops programs (#944)
* temporarily fix `collect_env` raise errors and stops programs

* remove the final catch block
2023-02-22 00:25:36 +08:00
Mashiro b14c179fad [Refactor] Refactor ema hook (#804)
* Refacot ema hook unit test

* Refacot ema hook unit test

* Enhance test_after_load_checkpoint

* refine error messsage

* Refine as comment

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Fix unit test
2023-02-22 00:08:38 +08:00
Mashiro aa69ba1a86 [Refactor] Refactor unit test of ParamSchedulerHook (#809)
* Refactor unit test of param_schemeduler hook

* Refactor unit test of param_schemeduler hook
2023-02-22 00:08:38 +08:00
Mashiro 29f399441f [Refactor] Use a real runner to test RuntimeInfohook (#810)
* Refactor RuntimeInfoHook

* Fix as comment
2023-02-22 00:08:38 +08:00
Mashiro c4efda4186 [Refactor] Use a real runner to test DistSamplerSeedHook (#812)
* Refactor unit test of DistSamplerSeedHook

* rename the case

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-22 00:08:38 +08:00
Mashiro a094976e9f [Refactor] Use a real runner to test IterTimerHook (#807)
* Refactor iter_timer_hook

* Refactor iter_timer_hook
2023-02-22 00:08:38 +08:00
Mashiro 4b781c336b [Refactor] Refactor unit test of EmptyCacheHook (#805)
* test EmptyCacheHook with runner

* Add coments
2023-02-22 00:08:38 +08:00
Mashiro 425ca99e90 [Refactor] Refactor unit test of Base hook (#806)
* refactor base hooks

* Fix CI
2023-02-22 00:08:38 +08:00
Zaida Zhou 67acdbe245
[Docs] Add a document about debug tricks (#938)
* fix typo

* [Docs] Add debug skills

* minor fix

* refine

* rename debug_skills to debug_tricks

* refine

* Update docs/en/common_usage/debug_tricks.md
2023-02-21 21:40:35 +08:00
Zaida Zhou 4861f034a7
[Docs] Count FLOPs and parameters (#939)
* [Docs] Count FLOPs and parameters

* add the doc to index.rst

* fix table in HTML

* fix

* fix

* fix indent

* refine
2023-02-21 21:16:18 +08:00
Mashiro 346989464c
[Docs] Add the document for the transition between IterBasedTraining and EpochBasedTraining (#926)
* Add epoch 2 iter

* Add epoch 2 iter

* Refine chinese docs

* Add example for training CIFAR10 by iter

* minor refine

* Fix as comment

* Fix as comment

* Refine description

* Fix as comment

* minor refine

* Refine description

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Translate to en

* Adjust indent

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-21 21:12:38 +08:00
luomaoling 3dc2be05d5
[Feature] Add NPUProfilerHook to profile performance in Ascend device (#925)
* Feature NPUProfilerHook

* Feature NPUProfilerHook
2023-02-21 17:20:40 +08:00
Zaida Zhou e16dacf7e3
Refine the repr of Registry (#942)
* Refine the repr of Registry

* fix ut

* fix ut
2023-02-21 13:18:11 +08:00
Zaida Zhou a6d06a424d
Fix failed URL (#943) 2023-02-21 10:48:07 +08:00
Zaida Zhou fd7917a7da
Refine the style of table (#941)
* Refine the style of table

* refine
2023-02-20 20:12:37 +08:00
Songyang Zhang aee2f6a688
[Feature] Support model complexity computation (#779)
* [Feature] Add support model complexity computation

* [Fix] fix lint error

* [Feature] update print_helper

* Update docstring

* update api, docs, fix lint

* fix lint

* update doc and add test

* update docstring

* update docstring

* update test

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/complexity_analysis.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/en/advanced_tutorials/model_analysis.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/en/advanced_tutorials/model_analysis.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update docs

* update docs

* update docs and docstring

* update docs

* update test withj mmlogger

* Update mmengine/analysis/complexity_analysis.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update tests/test_analysis/test_activation_count.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update test according to review

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* fix lint

* fix test

* Apply suggestions from code review

* fix API document

* Update analysis.rst

* rename variables

* minor refinement

* Apply suggestions from code review

* fix lint

* replace tabulate with existing rich

* Apply suggestions from code review

* indent

* Update mmengine/analysis/complexity_analysis.py

* Update mmengine/analysis/complexity_analysis.py

* Update mmengine/analysis/complexity_analysis.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: zhouzaida <zhouzaida@163.com>
2023-02-20 15:00:28 +08:00
wxDai 1d97c07068
[Docs] Fix typo shedule (#936) 2023-02-19 20:44:24 +08:00
vansin a3e5e03be6
Add the links of twitter, discord, medium, and youtube (#924)
* docs: update the discord link

* docs: update

* docs: update

* docs: update

* docs: update
2023-02-16 09:59:26 +08:00
whcao a5f48f7d99
[Bug] Fix the bug when the params in shared modules do not require grad (#903)
* fix the bug when the params in shared modules do not require grad

* test DefaultOptimWrapperConstructor when the params in shared modules do not require grad
2023-02-15 11:25:15 +08:00
Qian Zhao 30fe410b17
[Docs] Temporarily skip errors in building pdf docs at readthedocs (#928)
* temporarily skip readthedocs errors in building pdf docs

* fix error links

* remove useless links

* fix

* fix broken links as github url

* Update docs/zh_cn/notes/contributing.md

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-14 16:55:35 +08:00
Eiuyc c59899a65a
[Enhance] Beautify the print result of the registry (#922)
* beautify the print result of the registry

* remove tabulate and use rich for repr

* remove table width; text align to left

* sort _model_dict items
2023-02-14 16:32:11 +08:00
Zaida Zhou 502edec0b6
[Docs] how to set the interval parameter (#917)
* [Docs] how to set the interval parameter

* fix link

* fix

* fix

* refine

* refine

* Update docs/zh_cn/common_usage/set_interval.md

Co-authored-by: Qian Zhao <112053249+C1rN09@users.noreply.github.com>

* Update index.rst

---------

Co-authored-by: Qian Zhao <112053249+C1rN09@users.noreply.github.com>
2023-02-14 11:42:49 +08:00
Zaida Zhou 74fcaea0ab
[Docs] Introduce how to set random seed (#914)
* [Docs] Introduce how to set random seed

* add a comment
2023-02-13 16:14:48 +08:00
Zaida Zhou ad0b296fd4
Fix docstring (#913)
* Fix docstring

* fix
2023-02-13 16:10:53 +08:00
Qian Zhao c712070c90
[Docs] Resolve warnings in sphinx build (#915)
* add ZeroOptimizer to optim

* resolve `duplicate label` warnings

* upgrade docutils && shpinx to resolve `unknown directive or role` warnings

* fix typo

* resolve literal_block && heading warnings

* resolve json literal_block warnings

* resolve python literal_block warnings

* resolve bunches of reference warnings

* resolve bunches of docstring warnings

* resolve warnings in autosummary

* resolve remaining warnings in en docs

* resolve heading warnings in zh_cn docs

* resolve remaining warnings in zh_cn docs

* fix as comments

* fix as comments
2023-02-08 20:36:57 +08:00
Zaida Zhou 4749682885
[Docs] Move examples to a new directory (#911)
* [Docs] Move examples to a new directory

* fix typo
2023-02-07 17:03:35 +08:00
xcnick e35ed5fd2e
[Feature] Add ApexOptimWrapper (#742)
* add ApexOptimWrapper

* typo fix

* add apex amp.initialize in optim_context

* assert apex_amp

* polish code

* add parameters of apex_amp.initialize

* add docs

* polish code

* polish code

* polish code

* fix calling of apex amp load_state_dict

* polish

* add comments

* Update apex_optimizer_wrapper.py

* Update apex_optimizer_wrapper.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-06 15:30:10 +08:00
Zaida Zhou bc49e0c0a1
Update the links in the issue templates (#907) 2023-02-06 11:50:00 +08:00
Zaida Zhou d415136b1e
[Docs] Refine the format of changelog and visualization document (#906)
* [Docs] Fix format of changelog

* refactor the indent of code in docs
2023-02-06 00:41:25 +08:00
Xiang Xu 2cb71d93b3
[Docs] Update README (#835)
* Update link

* update zh version of readme

* fix typo

* Update README_zh-CN.md

* Update README_zh-CN.md

* Update README_zh-CN.md

* fix minor typo

* Update README_zh-CN.md

* Update README_zh-CN.md

* update docs

* Update infer.md

* Update README.md

* minor refinement

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-05 13:01:47 +08:00
Kevin Wang 4dad16fde2
[Feature] visualizer.draw_texts() adds a font_properties argument (#887)
* [Feature] visualizer.draw_texts() add a font_properties argument in order to show Chinese characters.

* [Fix] move font_properties argument to the end.

* Update docstring of font_properties parameter.

* [Fix] moving FontProperties import clause to draw_texts() and add TYPE_CHECKING

* Update mmengine/visualization/visualizer.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-03 17:05:13 +08:00
Alexander Pacha 1aa14b45a0
[Enhancement] Enable timeout in dist training (#877)
* Adding missing pre-commit requirement to tests.txt

* Added support for setting a timeout for distributed learning

* Adding documentation about how to change the runtime timeout into the distributed manual.

* Fixed type in documentation to correctly specify an integer

* Removing type-cast after checking the correct type already before

* Update mmengine/dist/utils.py

Adding an explicit `is not None` to the check

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Removing explicit type check and replacing it with more pythonic way of assuming it is the right type and handling the exception if the type doesn't match.

* Removing pre-commit from test requirements again

* Simplified the code according to suggestions from PR

* Update distributed.md

---------

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-03 15:40:39 +08:00
takuoko d1d4609fa2
[Feature] Support using optimizers from dadaptation (#902)
* add dadaptation

* Update mmengine/optim/optimizer/builder.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update dadaptation docs

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-03 15:00:32 +08:00
Mashiro 6dc1d7082a
[Fix] Support update np.ScalarType data in message_hub (#898)
* Clean the commit history

* Update message_hub.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-01 23:53:28 +08:00
Zaida Zhou 5753cd98e0
[Fix] backend_args should not be modified by get_file_backend (#897) 2023-02-01 14:47:22 +08:00
jbwang1997 c46f891a97
[Enhance] Substitute the environment variable in config file (#744)
* Add read environment variable function in config

* Add UT

* enable int case, split predefined and environment

* Update py config

* Add new attributes env_variables in config

* Add examples in docstring

* Fix comments

* Add tutorials

* Add en tutorials

* Refactor config docs according to comments

* Fix comments

* Change function name
2023-02-01 10:16:47 +08:00
Zaida Zhou acf21607be
[Enhancement] Improve registry infer_scope (#334)
* Improve registry infer_scope

* add warning info

* set scope as mmengine when failed to infer it

* refine message
2023-01-31 19:39:37 +08:00
tripleMu 498080b1d3
Use official isort (#895)
* fix lint

* cn fix lint
2023-01-31 14:04:16 +08:00
Zaida Zhou 2242fcabc3
[Fix] Upgrade the version of isort to fix lint error (#890)
* [Fix] Upgrade the version of isort to fix lint error

* Update .pre-commit-config-zh-cn.yaml

* Update .pre-commit-config.yaml
2023-01-29 15:53:11 +08:00
Mashiro 8d4885cb43
Bump version to v0.5.0 (#888)
* Bump version to v0.5.0

* Fix as comment

* Change release date

* Update README.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-01-20 12:37:13 +08:00
Mashiro 50465a2002
[Docs] Add Chinese documentation for inferencer (#884)
* [Feature] Add BaseInferencer (#773)

* Update BaseInferencer

* Fix ci

* Fix CI and rename iferencer to infer

* Fix CI

* Add renamed file

* Add test file

* Adjust interface sequence

* refine preprocess

* Update unit test

Update unit test

* Update unit test

* Fix unit test

* Fix as comment

* Minor refine

* Fix docstring and support load image from different backend

* Support load collate_fn from downstream repos, refine dispatch

* Minor refine

* Fix lint

* refine grammar

* Remove FileClient

* Refine docstring

* add rich

* Add list_models

* Add list_models

* Remove backend args

* Minor refine

* Fix typos in docs and type hints (#787)

* [Fix] Add _inputs_to_list (#795)

* Add preprocess inputs

* Add type hint

* update api/infer in index.rst

* rename preprocess_inputs to _inputs_to_list

* Fix doc format

* Update infer.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* [Fix] Fix alias type (#801)

* [Enhance] Support loading model config from checkpoint (#864)

* first commit

* [Enhance] Support build model from weight

* minor refine

* Fix type hint

* refine comments

* Update docstring

* refine as comment

* Add  method

* Refine docstring

* Fix as comment

* refine comments

* Refine warning message

* Fix unit test and refine comments

* add infer.md

* minor refine

* minor refine

* minor refine

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix conflicts and minor refine

* minor refine

* Fix as comment

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
2023-01-16 16:31:11 +08:00
Mashiro 2d8f2be375
[Feature] Add BaseInferencer (#874)
* [Feature] Add BaseInferencer (#773)

* Update BaseInferencer

* Fix ci

* Fix CI and rename iferencer to infer

* Fix CI

* Add renamed file

* Add test file

* Adjust interface sequence

* refine preprocess

* Update unit test

Update unit test

* Update unit test

* Fix unit test

* Fix as comment

* Minor refine

* Fix docstring and support load image from different backend

* Support load collate_fn from downstream repos, refine dispatch

* Minor refine

* Fix lint

* refine grammar

* Remove FileClient

* Refine docstring

* add rich

* Add list_models

* Add list_models

* Remove backend args

* Minor refine

* Fix typos in docs and type hints (#787)

* [Fix] Add _inputs_to_list (#795)

* Add preprocess inputs

* Add type hint

* update api/infer in index.rst

* rename preprocess_inputs to _inputs_to_list

* Fix doc format

* Update infer.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* [Fix] Fix alias type (#801)

* [Enhance] Support loading model config from checkpoint (#864)

* first commit

* [Enhance] Support build model from weight

* minor refine

* Fix type hint

* refine comments

* Update docstring

* refine as comment

* Add  method

* Refine docstring

* Fix as comment

* refine comments

* Refine warning message

* Fix unit test and refine comments

* replace MODULE2PACKAGE to MODULE2PAKCAGE

* Fix typo and syntax error in docstring

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
2023-01-16 16:01:06 +08:00
Mashiro ad590e45a2
[Enhance] Disable warning of subprocess launched by dataloader (#870)
* Disable warning of subprocess launched by dataloader

* Add type hint
2023-01-16 14:09:47 +08:00
LEFTeyes 0b59a90a21
[Feature] Support ReduceOnPlateauParamScheduler(#819)
* [Feature] Add ReduceOnPlateauParamScheduler and change ParamSchedulerHook

* [Feature] add ReduceOnPlateauLR and ReduceOnPlateauMomentum

* pre-commit check

* add a little docs

* change position

* fix the conflict between isort and yapf

* fix ParamSchedulerHook after_val_epoch execute without train_loop and param_schedulers built

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* update ReduceOnPlateauParamScheduler, ReduceOnPlateauMomentum and ParamSchedulerHook

* fix get need_step_args attribute error in ParamSchedulerHook

* fix load_state_dict error for rule in ReduceOnPlateauParamScheduler

* add docs for ParamSchedulerHook and fix a few codes

* [Docs] add ReduceOnPlateauParamScheduler, ReduceOnPlateauMomentum and ReduceOnPlateauLR docs

* [Refactor] adjust the order of import

* [Fix] add init check for threshold in ReduceOnPlateauParamScheduler

* [Test] add test for ReduceOnPlateauParamScheduler, ReduceOnPlateauLR and ReduceOnPlateauMomentum

* [Fix] fix no attribute self.min_value

* [Fix] fix numerical problem in tests

* [Fix] fix error in tests

* [Fix] fix ignore first param in tests

* [Fix] fix bug in tests

* [Fix] fix bug in tests

* [Fix] fix bug in tests

* [Fix] increase coverage

* [Fix] fix count self._global_step bug and docs

* [Fix] fix tests

* [Fix] modified ParamSchedulerHook test

* Update mmengine/optim/scheduler/param_scheduler.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* [Fix] modified something according to commented

* [Docs] add api for en and zh_cn

* [Fix] fix bug in test_param_scheduler_hook.py

* [Test] support more complicated test modes(less, greater, rel, abs) for ReduceOnPlateauParamScheduler

* [Docs] add docs for rule

* [Fix] fix pop from empty list bug in test

* [Fix] fix check param_schedulers is not built bug

* [Fix] fix step_args bug and without runner._train_loop bug

* [Fix] fix step_args bug and without runner._train_loop bug

* [Fix] fix scheduler type bug

* [Test] rename step_args to step_kwargs

* [Fix] remove redundancy check

* [Test] remove redundancy check

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* [Test] fix some defects

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-01-16 11:39:03 +08:00
Mashiro 9d3f5b21c1
[Fix] Fix error package name defined in `PKG2PROJECT` (#872)
* Fix PKG2PROJECT

* Rename PKG2PROJECT to MODULE2PACKAGE

* Fix ci

* Remove unnecessary change
2023-01-13 18:17:41 +08:00
Xiangxu-0103 2402fb158f
[Docs] Refine fileio.md (#869)
* Create fileio.md

* Update fileio.md

* Update fileio.md

* fix minor comments

* Update fileio.md
2023-01-13 10:24:27 +08:00
Zaida Zhou c89d4ef815
[Enhance] Remove unnecessary calls and lazily import to speed import performance (#837)
* [Enhance] Remove unnecessary calls to speed import performance

* lazily import matplotlib

* minor refinement
2023-01-13 10:17:43 +08:00
Ma Zerun fcd783fcb2
[Enhance] Support non-scalar type metric value. (#827)
* [Enhance] Support non-scalar type metric value.

* Refactor support.

* Fix non-scalar tags problem during validation

* Update tag processor.
2023-01-12 20:28:55 +08:00
wangjiangben-hw 79067e4628
[Fix] Add support for Ascend device (#847)
* add npu device support

* add comment for torch.npu.set_compile_mode
2023-01-10 13:38:56 +08:00