15 Commits

Author SHA1 Message Date
xuuyangg
f67ef9c128
[Fix] Fix mix training on Ascend NPU (#3215)
## Motivation

Address an issue where mix training is not enabled when optimizer_config
is present in the config on Ascend NPU

## Modification

Previously, mix training was not enabled when optimizer_config was
present in the configuration on Ascend NPU. This commit addresses the
issue by ensuring that mix training is enabled under these
circumstances.

## Use cases 

It has been validated on the
knet_s3_upernet_swin-l_8x2_640x640_adamw_80k_ade20k.py config.

## Checklist

1. Pre-commit or other linting tools are used to fix the potential lint
issues.
2. The modification is covered by complete unit tests. If not, please
add more unit test to ensure the correctness.
3. If the modification has potential influence on downstream projects,
this PR should be tested with downstream projects, like MMDet or
MMDet3D.
4. The documentation has been modified accordingly, like docstring or
example tutorials.
2023-07-22 14:07:31 +08:00
Yinlei Sun
0beaf69047
[Enhance] Enable full precision training on Ascend NPU. (#3085)
## Motivation

We will support full precision training on the next generation Ascend
NPU, so there is no need to enable mixed precision by default.

## Modification

Determine whether the current chip supports full precision training, and
automatically enable mixed precision.

## BC-breaking (Optional)

Not affected.

## Use cases (Optional)

We have verified the correctness on the Ascend NPU.
2023-06-07 15:30:24 +08:00
luomaoling
ae78cb9d53
[Feature] Support mmseg with NPU backend. (#2768)
## Motivation

Added ascending device support in mmseg.

## Modification

The main modification points are as follows:
We added an NPU device in the DDP scenario and DP scenario when using
the NPU.

## BC-breaking (Optional)

None

## Use cases (Optional)

We tested
[fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/unet/fcn_unet_s5-d16_4x4_512x1024_160k_cityscapes.py)
.
2023-03-23 19:42:49 +08:00
Aston.He
7628a61f92
feat(mlu): Support PyTorch backend on MLU. (#1515)
* feat(mlu): Support PyTorch backend on MLU.

* fix redundant device variable.

* Update mmseg/apis/train.py

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* Update comments.

* Update mmseg/apis/train.py

* Update is_mlu_available flag.

* align util_distribution.py to mmdet.

* align util_distribution.py to mmdet.

* add build_dp, build_ddp testcase.

* Update mmseg/utils/util_distribution.py

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

* Update mmseg/utils/util_distribution.py

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

* Update mmseg/utils/util_distribution.py

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

* Update tests/test_utils/test_util_distribution.py

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

* Update tests/test_utils/test_util_distribution.py

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

* Update tests/test_utils/test_util_distribution.py

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

* Update tests/test_utils/test_util_distribution.py

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

* add mmcv version check for mlu device.

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-25 18:11:42 +08:00
FangjianLin
5b605b086d
[Fix] Register optimizer constructor with mmseg (#1456)
* [fix] register optimizer onstructor with mmseg

* fix lint

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Update tests/test_core/test_optimizer.py

* Update tests/test_core/test_optimizer.py

* Update tests/test_core/test_optimizer.py

* Update tests/test_core/test_optimizer.py

* fix lint

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-04-16 16:45:17 +08:00
Miao Zheng
3f797072d8
[Enhance] Add extra dataloader settings in configs (#1435)
* [Enhance] Add extra dataloader settings in configs

* val default samples

* val default samples

* del unuse

* del unused
2022-04-13 13:30:10 +08:00
Miao Zheng
3432ea98db
Add DistSamplerSeedHook for when runner is EpochBasedRunner (#1449)
* Add DistSamplerSeedHook for when runner is EpochBasedRunner

* add comment
2022-04-06 22:04:11 +08:00
MengzhangLI
ecda117ea5
[Enhance] New-style CPU training and inference. (#1251)
* [Enhance] New-style CPU training and inference.

* assert mmcv version

* SyncBN to BN in training and testing

* SyncBN to BN in training and testing

* upload untracked files to this branch

* delete gpu_ids

* fix bugs

* assert args.gpu_id in train.py

* use cfg.gpu_ids = [args.gpu_id]

* use cfg.gpu_ids = [args.gpu_id]

* fix typo

* fix typo

* fix typos
2022-01-28 23:03:01 +08:00
Rockey
78fdf65382
[Feature] add auto resume (#1172)
* [Feature] add auto resume

* Update mmseg/utils/find_latest_checkpoint.py

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* Update mmseg/utils/find_latest_checkpoint.py

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* modify docstring

* Update mmseg/utils/find_latest_checkpoint.py

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* add copyright

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
2022-01-11 12:27:24 +08:00
Junjun2016
f0426c97d7
[Enchance] Set a random seed when the user does not set a seed. (#1039) 2021-11-26 10:55:15 +08:00
gszh
845098b155
Update train.py (#428)
* Update train.py

Add user-defined hooks.

* Update train.py

* Update train.py
2021-10-29 12:13:40 -07:00
Junjun2016
441be4e435
[Dcos] Add header for files (#796)
* Add header for files

* Delete header in config files
2021-08-16 23:16:55 -07:00
Junjun2016
9155d9e9ed
[Fix] Fix the log error (#766)
* set the priority of EvalHook to LOW

* add comment for priority change

* fix comment
2021-08-09 17:20:02 -07:00
David de la Iglesia Castro
e384ef578a
Add runner type (#118)
* Add runner_type option

* pre-commit

* Fix max_iters

* Add by_epoch to EvalHook

* Add test_eval_hook for epoch runner

* Remove runner-type arg from tools/train

* Add missing every_n_iters check for epoch mode

* Bump mmcv min version

* Use build_runner

* Use interval in tests

* Update test_eval_hook.py

* Use every_n_epochs instead of every_n_iters. Update DistEvalHook

* Add test_dist_eval_hook_epoch

* Fix tests

* Add DeprecationWarning

* Update docs

* Replace DeprecationWarning with UserWarning
2020-10-25 15:18:46 -07:00
Jiarui XU
b2724da80b init commit 2020-07-10 02:39:01 +08:00