pytorch-lightning icon indicating copy to clipboard operation
pytorch-lightning copied to clipboard

Avoid raising the sampler warning if num_replicas=1

Open rohitgr7 opened this issue 3 years ago • 2 comments

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

rohitgr7 avatar Aug 08 '22 18:08 rohitgr7

Codecov Report

Merging #14097 (91c5ced) into master (45a10a1) will decrease coverage by 3%. The diff coverage is 100%.

: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     

codecov[bot] avatar Aug 08 '22 19:08 codecov[bot]

@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".

awaelchli avatar Aug 09 '22 07:08 awaelchli