Avoid raising the sampler warning if num_replicas=1
What does this PR do?
Dont' raise a warning if devices=1 already and ddp is still used.
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
- [ ] Was this discussed/approved via a GitHub issue? (not for typos and docs)
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Did you make sure your PR does only one thing, instead of bundling different changes together?
- [ ] Did you make sure to update the documentation with your changes? (if necessary)
- [ ] Did you write any new necessary tests? (not for typos and docs)
- [x] Did you verify new and existing tests pass locally with your changes?
- [x] Did you list all the breaking changes introduced by this pull request?
- [x] Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)
PR review
Anyone in the community is welcome to review the PR. Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
- [x] Is this pull request ready for review? (if not, please submit in draft mode)
- [x] Check that all items from Before submitting are resolved
- [x] Make sure the title is self-explanatory and the description concisely explains the PR
- [x] Add labels and milestones (and optionally projects) to the PR so it can be classified
Did you have fun?
Make sure you had fun coding 🙃
cc @justusschock @awaelchli @ninginthecloud @rohitgr7 @otaj
Codecov Report
Merging #14097 (91c5ced) into master (45a10a1) will decrease coverage by
3%. The diff coverage is100%.
:exclamation: Current head 91c5ced differs from pull request most recent head 752c6d4. Consider uploading reports for the commit 752c6d4 to get more accurate results
@@ Coverage Diff @@
## master #14097 +/- ##
==========================================
- Coverage 79% 76% -3%
==========================================
Files 106 326 +220
Lines 7066 26600 +19534
==========================================
+ Hits 5592 20235 +14643
- Misses 1474 6365 +4891
@rohitgr7 We used to fall back to single device when strategy="ddp" and devices=1. We wouldn't even cross this code path since no distributed sampler is required in this case. This must have been lost in the accelerator connector "refactor".