-
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
Skip replacing dataloader sampler if it's already a distributed sampler #4273
Conversation
Has this change already been approved by one of our team members? |
Codecov Report
@@ Coverage Diff @@
## master #4273 +/- ##
======================================
Coverage 92% 93%
======================================
Files 111 111
Lines 8075 8021 -54
======================================
- Hits 7466 7455 -11
+ Misses 609 566 -43 |
@s-rog while this is true, we still can do that type check and the main idea of that flag is being able to turn it off (which you still can) |
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.
Do we already have a test that covers this new behavior? Otherwise LGTM!
@s-rog I'll add one for a dataloader configured with a distributed sampler and |
Be careful, with this change, the docs are slightly misleading now. It currently reads:
|
984c73f
to
fd56332
Compare
9727562
to
85ad318
Compare
LGTM. Great idea! |
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.
We need to fix the test, seems like its failing on multiple GPUs.
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.
just trying.
I suggest while adding a sampler we should explicitlly set |
@rohitgr7 think we should include that in this PR or handle this separately? |
@SeanNaren either way is fine or let's just do it separately and also here in EDIT: Let's change it here. Not a big one. |
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.
please wait
What does this PR do?
This PR skips replacing the dataloader's sampler if the sampler is already of type
DistributedSampler
. Currently this raises aMisconfigurationException
.This causes confusion, since
trainer.replace_sampler_ddp
is by defaultTrue
. In these cases, we can silently skip replacing the sampler instead of failing.Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃