Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enchance] Support random seed for distributed sampler #1411

Merged
merged 6 commits into from
Mar 28, 2022

Conversation

MengzhangLI
Copy link
Contributor

@MengzhangLI MengzhangLI commented Mar 23, 2022

Motivation

Modify distributed sampler and keep the manual_seed behavior same with pytorch original version

Refers to open-mmlab/mmdetection#7440, open-mmlab/mmdetection#7432 and open-mmlab/mmagic#815.

Modification

add seed to distributed sampler and apply g.manual_seed(self.epoch + self.seed)
synchronize the seed in init function

@MengzhangLI MengzhangLI self-assigned this Mar 23, 2022
Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #1411 (23e6412) into master (98984bf) will decrease coverage by 0.17%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master    #1411      +/-   ##
==========================================
- Coverage   90.39%   90.22%   -0.18%     
==========================================
  Files         133      136       +3     
  Lines        7906     7949      +43     
  Branches     1318     1323       +5     
==========================================
+ Hits         7147     7172      +25     
- Misses        536      552      +16     
- Partials      223      225       +2     
Flag Coverage Δ
unittests 90.22% <60.00%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/datasets/samplers/distributed_sampler.py 52.38% <52.38%> (ø)
mmseg/core/utils/dist_util.py 55.55% <55.55%> (ø)
mmseg/core/utils/__init__.py 100.00% <100.00%> (ø)
mmseg/datasets/builder.py 86.90% <100.00%> (+0.15%) ⬆️
mmseg/datasets/samplers/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d51115...23e6412. Read the comment docs.

@MeowZheng MeowZheng merged commit f3ae234 into open-mmlab:master Mar 28, 2022
mob5566 pushed a commit to mob5566/mmsegmentation that referenced this pull request Apr 13, 2022
* support random seed for distributed sampler

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* change dist sampler

* change dist sampler

* fix docstring in sync_random_seed
ZhimingNJ pushed a commit to AetrexTechnology/mmsegmentation that referenced this pull request Jun 29, 2022
* support random seed for distributed sampler

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* move mmseg/utils/dist_util.py to mmseg/core/utils/dist_util.py

* change dist sampler

* change dist sampler

* fix docstring in sync_random_seed
@MengzhangLI MengzhangLI deleted the dist_seeds branch July 15, 2022 03:36
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* call contiguous after permute

Fixes for MPS device

* Fix MPS UserWarning

* make style

* Revert "Fix MPS UserWarning"

This reverts commit b46c32810ee5fdc4c16a8e9224a826490b66cf49.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants