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

Disallow batch sampler with multiple IPU devices #13854

Merged
merged 11 commits into from
Jul 27, 2022

Conversation

otaj
Copy link
Contributor

@otaj otaj commented Jul 26, 2022

What does this PR do?

When running on multiple IPUs, poptorch.DataLoader increases batch size, which is not compatible with batch_sampler argument at all. This was discovered during debugging of #13640

Does your PR introduce any breaking changes? If yes, please list them.

It is impossible to have a BatchSampler in while running on multiple IPUs. This never worked, however the user did not get an error message about it, but some different one, later on. Now the attempt to have explicit BatchSampler fails.

Note that users can still pass batch_size argument, which creates a default BatchSampler under the hood and this still works

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs) (on Slack it was)
  • Did you read the contributor guideline, Pull Request section?
  • 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)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • 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:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • 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 @Borda @akihironitta

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Jul 26, 2022
@otaj otaj added bug Something isn't working breaking change Includes a breaking change strategy: ipu (removed) labels Jul 26, 2022
@otaj otaj self-assigned this Jul 26, 2022
@otaj otaj added this to the pl:1.6.x milestone Jul 26, 2022
docs/source-pytorch/accelerators/ipu_basic.rst Outdated Show resolved Hide resolved
src/pytorch_lightning/strategies/ipu.py Outdated Show resolved Hide resolved
tests/tests_pytorch/utilities/test_data.py Outdated Show resolved Hide resolved
src/pytorch_lightning/utilities/data.py Outdated Show resolved Hide resolved
@carmocca carmocca added the data handling Generic data-related topic label Jul 26, 2022
tests/tests_pytorch/utilities/test_data.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Jul 26, 2022
@codecov
Copy link

codecov bot commented Jul 26, 2022

Codecov Report

Merging #13854 (7fdd6e7) into master (a90ef3b) will increase coverage by 27%.
The diff coverage is 82%.

@@            Coverage Diff            @@
##           master   #13854     +/-   ##
=========================================
+ Coverage      49%      76%    +27%     
=========================================
  Files         332      332             
  Lines       26000    26054     +54     
=========================================
+ Hits        12728    19812   +7084     
+ Misses      13272     6242   -7030     

src/pytorch_lightning/strategies/ipu.py Outdated Show resolved Hide resolved
@otaj otaj enabled auto-merge (squash) July 27, 2022 08:53
@otaj otaj merged commit 4c7b9f0 into master Jul 27, 2022
@otaj otaj deleted the bugfix/disallow_batch_sampler_on_ipu branch July 27, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Includes a breaking change bug Something isn't working data handling Generic data-related topic pl Generic label for PyTorch Lightning package ready PRs ready to be merged strategy: ipu (removed)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants