Commit Graph

61 Commits (e146233546631d1fd56f9c32d406f09d86d95f71)
 

Author SHA1 Message Date
Zaida Zhou e146233546
fix documentation (#91) 2022-03-06 14:36:46 +08:00
Zaida Zhou c6a8d72c5e
[Feature] Add distributed module (#59)
* [Feature] Add distributed module

* fix IS_DIST error

* all_reduce_dict does operations in-place

* support 'mean' operation

* provide local group process

* add tmpdir argument for collect_results

* add unit tests

* refactor unit tests

* simplify steps to create multiple processes

* minor fix

* describe the different of *gather* in mmengine and pytorch

* minor fix

* add unit tests for nccl

* test nccl backend in multiple gpu

* add get_default_group function to handle different torch versions

* minor fix

* [Feature] Add distributed module

* fix IS_DIST error

* all_reduce_dict does operations in-place

* support 'mean' operation

* provide local group process

* add tmpdir argument for collect_results

* add unit tests

* refactor unit tests

* simplify steps to create multiple processes

* minor fix

* describe the different of *gather* in mmengine and pytorch

* minor fix

* add unit tests for nccl

* test nccl backend in multiple gpu

* add get_default_group function to handle different torch versions

* minor fix

* minor fix

* handle torch1.5

* handle torch1.5

* minor fix

* fix typo

* refactor unit tests

* nccl does not support gather and gather_object

* fix gather

* fix collect_results_cpu

* fix collect_results and refactor unit tests

* fix collect_results unit tests

* handle torch.cat in torch1.5

* refine docstring

* refine docstring

* fix comments

* fix comments
2022-03-05 22:03:32 +08:00
Wenwei Zhang 817eb89ac2
Add user docs for get_config/get_models (#83)
* add user docs for get_config/get_models

* resolve comments
2022-03-05 17:46:27 +08:00
Zaida Zhou fd85156412
fix type hint and format (#88) 2022-03-05 17:44:31 +08:00
liukuikun 11b38b12d6
[Fix] fix random may generate same value (#85) 2022-03-05 15:02:54 +08:00
Miao Zheng 43dcc5648f
[Fix] Typo in Logging doc (#81) 2022-03-04 19:44:31 +08:00
RangiLyu 05ff046c3b
ignore ut of unimplemented modules (#79) 2022-03-04 11:09:10 +08:00
RangiLyu 64b1d183b9
Add runner unit tests. (#68)
* add runner unit tests

* update

* update

* add test custom loop and hook

* add test model wrapper

* add test setup env

* fix typo

* fix launcher

* fix typo

* test default scope

* add logger test

* fix dataloader

* add test loop

* resolve comments

* resolve comments
2022-03-03 19:44:36 +08:00
Mashiro c87adc66a4
Fix BaseGlobalAssible in Python 3.7 (#76)
Fix CI
2022-03-03 19:43:16 +08:00
Yifei Yang 149248ce52
[Feature] Add Sync Buffer Hook (#57)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* add sync buffer hook

* update typing hint and docs

* fix lint

* fix mypy

* fix lint

* use mock from unittest

Co-authored-by: seuyou <3463423099@qq.com>
2022-03-03 17:13:43 +08:00
Mashiro 12b916cf6f
[Feature] add base global access (#72)
* add impl

* add test

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment
2022-03-02 23:38:04 +08:00
Yuan Liu cf239a2b17
[Feature]: Add checkpoint hook (#66)
* [Feature]: Add checkpoint hook

* [Fix]: Fix lint

* [Fix]: Delete redundant optional and give an example to our_dir

* [Feature]: Add test the last_ckpt in UT

* [Fix]: Fix docstring problem

* [Fix]: Add patch to UT

* [Feature]: Add Test case for by epoch
2022-03-02 22:01:58 +08:00
Yifei Yang 2448380339
use unittest mock (#71) 2022-03-02 21:53:40 +08:00
Yifei Yang 94ab45d07e
[Feature] Add empty cache hook (#58)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* [Fix]: Add test case to not the last iter, inner_iter, epoch

* [Fix]: Add missing type hint

* [Feature]: Add Args and Returns in docstring

* [Fix]: Add missing colon

* [Fix]: Add optional to docstring

* [Fix]: Fix docstring problem

* [Fix]: Fix lint

* fix lint

* update typing and docs

* fix lint

* Update mmengine/hooks/empty_cache_hook.py

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

* Update mmengine/hooks/empty_cache_hook.py

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

* Update mmengine/hooks/empty_cache_hook.py

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

* Update tests/test_hook/test_empty_cache_hook.py

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

* fix lint

* fix comments

* remove test condition

Co-authored-by: seuyou <3463423099@qq.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-03-02 14:04:41 +08:00
Yuan Liu 63a3af4f8c
[Feature]: Add optimizer hook (#70)
* [Feature]: Add optimizer hook

* [Fix]: Update docstring

* [Fix]: Add call with in UT
2022-03-01 17:42:15 +08:00
RangiLyu ee95ce2488
[Doc] Add runner tutorial. (#55)
* [Doc] Add runner tutorial.

* update

* add advanced doc

* refine and add flow chart

* update

* update
2022-03-01 15:58:34 +08:00
Yuan Liu ab31e1936e
[Feature]: Add param scheduler hook (#63)
* [Feature]: Add param scheduler hook

* [Fix]: update docstring and add assert_call to UT
2022-03-01 15:49:44 +08:00
Yuan Liu 2d3e91248c
[Feature]: Add sampler seed hook (#64)
* [Feature]: Add sampler seed hook

* [Fix]: Add call with to UT
2022-03-01 15:38:01 +08:00
Yifei Yang 1244e486ae
[Feature] Add Iter Timer Hook (#48)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* add iter timer hook

* update test

* [Fix]: Add docstring and type hint for base hook

* fix mypy

* improve doc coverage and merge main

Co-authored-by: seuyou <3463423099@qq.com>
2022-03-01 12:02:34 +08:00
Yining Li 42448425b3
[Feature] Add evaluator unittest (#46)
* add evaluator unittest

* update composed evaluator cfg

* add building function

* resolve comments

* resolve comments

* resolve comments

* fix evaluator doc
2022-03-01 12:00:19 +08:00
Zaida Zhou 7313173405
[Docs] Add hooks tutorial (#38)
* [Docs] Add hooks tutorial

* improve the description about hooks

* Add OptimizerHook usages

* fix comments

* fix comments

* fix comments

* fix comments

* fix typo

* refine description

* refactor

* refactor

* add a sentence to improve docs

* briefly introduce the hook of pytorch

* refactor the order of sections

* improve the description about hooks

* improve

* fix comments

* update priorities

* improve description

* refactor title

* fix typo

* reorder priority of hook

* fix typo

* fix comments

* remove the distributed argument from SyncBuffersHook
2022-03-01 11:57:29 +08:00
Mashiro 84b8106aae
[Docs] Add logging doc (#39)
* first commit

* add logging doc

* add logging doc

* Fix lint

* Fix typo

* add logging

* update docs

* update logging.md

* update logging.md

* scale img

* update logging docs

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

Fix as comment

* add introduction to current=True

* Fix as comment

Fix as comment

* Fix as comment

* Fix as comment
2022-03-01 11:54:43 +08:00
RangiLyu c2c5664fad
Fix pt1.5 unit tests. (#65)
* Fix pt1.5 unit tests.

* move to mmengine.testing
2022-03-01 11:28:21 +08:00
Ma Zerun 1e5056ea7a
Stop using generic `Sampler` since it's not supported in early version (#56)
PyTorch.
2022-02-27 20:35:41 +08:00
Haian Huang(深度眸) 5170676a2f
fix mmdp unittest (#60) 2022-02-27 20:34:52 +08:00
Yuan Liu bc759e5550
[Feature]: Add base Hook (#47)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* [Fix]: Add test case to not the last iter, inner_iter, epoch

* [Fix]: Add missing type hint

* [Feature]: Add Args and Returns in docstring

* [Fix]: Add missing colon

* [Fix]: Add optional to docstring

* [Fix]: Fix docstring problem

* [Fix]:typo

* [Fix]: Fix lint

Co-authored-by: Your <you@example.com>
2022-02-26 14:51:09 +08:00
Haian Huang(深度眸) 492b2f2fa8
[Feature] Add MMDataParallel and MMDistributedDataParallel (#44)
* add mmddp

* update

* update code

* update unittest

* fix comment
2022-02-26 10:21:20 +08:00
Wenwei Zhang 95172781f2
Add user doc of distributed primitives (#45)
* add user doc of distributed primitives

* resolve comments

* update
2022-02-25 15:38:43 +08:00
Zaida Zhou 1e79b97444
Mock unimplemented modules and fix unit tests (#54)
* Mock unimplemented modules and fix unit tests

* add a comment
2022-02-25 15:24:27 +08:00
Yining Li 92de63eed7
[Docs] Add evaluator docs (#33)
* add evaluator docs

* resolve comments

* resolve comments
2022-02-25 14:43:16 +08:00
RangiLyu d0bcb83e41
[Feature]: Add evaluator base class. (#41)
* [Feature]: Add evaluator base class.

* solve comments

* update

* fix
2022-02-24 23:41:42 +08:00
liukuikun 9437ebea67
[Feat]: Add abstract data structure (#29)
* [WIP] abstract-data-structure

* update docs

* update

* update BaseDataSample

* fix comment and coverage 100%

* update and add _set_field

* update

* split  into base_data_element and base_data_sample

* update

* update

* update

* fix typo
2022-02-22 21:45:32 +08:00
Mashiro e1f11fa595
[FIx] Fix basedataset doc (#40)
* Fix BaseDataset docs

* Fix basedataset doc
2022-02-22 21:44:16 +08:00
Mashiro ada6660c65
[Feature] add base dataset (#32)
* basedataset first commit

* add base dataset

* add dataset

* add basedataset

* Fix test dataset

* Fix mypy and test

* Fix mypy and test

* remove unused code

* Update mmengine/dataset/base_dataset.py

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

* Update mmengine/dataset/base_dataset.py

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

* add more corner cases in unittest

* fix lint

* Fix as comment

* Fix lint

* update unitest

* Type hint Dick to dict

* rename max_refetch

* Fix as comment

* Fix typo

* Fix as comment

* BaseDataset is no more an abstrac Class, change UT and docs

* Fix as comment

* Fix as comment and refactor type error

* Add comment for full init

* Fix as comment and modify dataset_wrapper

* Fix as comment and modify dataset_wrapper

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Tao Gong <gongtao950513@gmail.com>
2022-02-22 14:01:06 +08:00
Haian Huang(深度眸) adb2aee8c2
[Unittest] Add visualizer unittest (#27)
* add visualizer unittest

* update

* fix comment

* fix commit

* fix comment

* fix comment
2022-02-21 20:55:11 +08:00
Ma Zerun f0451a38f0
[Feature] Add data sampler (#30)
* Add DefaultSampler and InfiniteSampler

* Add unit test

* Add samplers to API reference

* Update docstring

* Improve according to comments

* Rename `num_replicas` to `world_size`

* Update docstring.

* Update mmengine/data/sampler.py

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

* Update mmengine/data/sampler.py

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

* Fix typo in unit test

Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-02-21 13:08:55 +08:00
RangiLyu 7353778b7c
[Feature]: Add optimzier and constructor. (#25)
* [Feature]: Add optimzier and constructor.

* refactor unit tests

* add optimizer doc

* add parrots wrapper

* add parrots wrapper

* solve comments

* resolve comments
2022-02-19 14:09:37 +08:00
Zaida Zhou dd6fb223e6
Fix setup.py and add requirements.txt (#37) 2022-02-19 13:43:36 +08:00
Zaida Zhou 368b4bd50a
Add runtime.txt and tests.txt (#36) 2022-02-19 12:55:56 +08:00
Mashiro b8e7c8ee8f
Fix test_auto_argparse when pytest has multiple arguments (#34) 2022-02-19 12:22:15 +08:00
Haian Huang(深度眸) e908959c31
[Docs] add visualizer docs (#16)
* add visualizer

* update

* update

* update

* update

* update

* fix lint

* fix commit

* fix commit

* fix commit

* fix commit

* refine

* refine

* update

* update

* update

* update

* update
2022-02-17 22:33:52 +08:00
Yifei Yang 6bd813c8ba
[Feature] Add Config (#24)
* add config test

* Fix typo

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

* Update tests/config/test_config.py

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

* Reconstruct config test

* Fix import logic and error test

* Fix path error

* Restructuring Config

* simplify test logic

simplify test logic

* add config

* [Feature] Add Config

* fix lint

* remove test_config

* cancel change to pre-commit yaml

* solve conflict

* fix comments

* merge main

* fix lint

* update

* remove some magic docs

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* add deprecation test

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* Update mmengine/config/config.py

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

* update

* fix mypy

* fix lint

* fix super

* improve ut coverage

* add test dump

Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-02-17 22:33:21 +08:00
Zaida Zhou e2df3ed9fe
Ignore the docstring of magic methods (#28) 2022-02-17 21:00:35 +08:00
Mashiro 8751231103
add config test (#10)
* add config test

* Fix typo

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

* Update tests/config/test_config.py

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

* Reconstruct config test

* Fix import logic and error test

* Fix path error

* Restructuring Config

* simplify test logic

simplify test logic

* rename test_config file

* add test complex dump and pretty text

* adjust test sequence according to comment

adjust test sequence according to comment

* add comment and test for simple.config.py

* add config test data

* add init

* remove __pycache__

* fix as comment

* add syntax test case

* remove tmp path and modify comment

* add test for setattr

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-02-17 17:46:06 +08:00
RangiLyu 7905f039b6
[Feature]: Add parameter schedulers. (#22)
* [Feature]: Add parameter schedulers.

* update

* update

* update

* update

* add docstring to lr and momentum

* resolve comments
2022-02-16 23:43:59 +08:00
Wenwei Zhang 41e1191cbc
add unit tests of data abstract interface (#21)
* add unit tests of data abstract interface

* update

* update

* update docs of data element

* a draft of UT of datasample, to be finished

* update datasample test

* updata

* update

* fix comments

* fix comments

* fix comments

Co-authored-by: liukuikun <liukuikun@sensetime.com>
2022-02-16 23:19:18 +08:00
RangiLyu bbb7d625e6
add scheduler unit test (#13)
* tmp

* add scheduler unit test

* disable yapf

* add more test

* add more test

* not use torch test case

* solve comments

* update file

* add more unit tests

* resolve comments

* update cosine ut

* fix typo

* solve comments

* solve comments

* resolve comments
2022-02-16 22:33:46 +08:00
Zaida Zhou cccd20a636
[Feature] Add Registry (#11) 2022-02-16 21:45:39 +08:00
Zaida Zhou 166ca02363
[Refactor] Move fileio directory from utils (#23)
* move fileio directory from utils

* remove CephBackend from fileio and clear some deprecated docstring

* fix format

* fix a spellling error
2022-02-15 23:43:20 +08:00
Zaida Zhou 3b5e4606b6
[Fix] Fix the type hint of fileio module (#20) 2022-02-15 20:39:43 +08:00