-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[bugfix] Add support for CombinedLoader in validation with ddp #7102
Conversation
Hello @tchaton! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-04-20 07:52:39 UTC |
Codecov Report
@@ Coverage Diff @@
## master #7102 +/- ##
=======================================
- Coverage 92% 87% -5%
=======================================
Files 197 197
Lines 12634 12686 +52
=======================================
- Hits 11649 11039 -610
- Misses 985 1647 +662 |
tests/trainer/test_supporters.py
Outdated
def validation_step(self, batch, batch_idx): | ||
v = batch['a'] | ||
assert (v + int(self.trainer.global_rank == 1)) % 2 == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we are testing the DistributedSampler in a full special test.
Would a simpler test do it? We have similar tests in tests/trainer/test_dataloaders
dataloader = CombinedLoader()
trainer = Trainer()
dataloader = trainer.auto_add_sampler(dataloader)
assert all(isinstance(loader.sampler, DistributedSampler) for loader in dataloader.loaders))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great comment ! You are definitely right ! Let me update the test.
What does this PR do?
This PR add support resolve a bug with CombinedLoader and DDP.
Fixes #7013
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃