-
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
Avoid wrapping prediction dataloader twice on TPU #16571
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Liyang90
requested review from
williamFalcon,
awaelchli,
carmocca and
justusschock
as code owners
January 31, 2023 00:23
Liyang90
changed the title
Update tpu_spawn.py
Avoid wrapping prediction dataloader twice on TPU
Jan 31, 2023
awaelchli
added
accelerator: tpu
Tensor Processing Unit
bug
Something isn't working
labels
Jan 31, 2023
carmocca
approved these changes
Jan 31, 2023
awaelchli
approved these changes
Feb 1, 2023
mergify
bot
added
ready
PRs ready to be merged
has conflicts
and removed
has conflicts
ready
PRs ready to be merged
labels
Feb 1, 2023
carmocca
force-pushed
the
xla_prediction
branch
from
February 2, 2023 00:40
e66c0cb
to
fe64b38
Compare
pre-commit-ci
bot
requested review from
tchaton,
lantiga,
hhsecond,
ethanwharris and
edenlightning
as code owners
February 2, 2023 00:41
github-actions
bot
added
the
app (removed)
Generic label for Lightning App package
label
Feb 2, 2023
github-actions
bot
removed
the
app (removed)
Generic label for Lightning App package
label
Feb 2, 2023
mergify
bot
added
ready
PRs ready to be merged
and removed
has conflicts
ready
PRs ready to be merged
labels
Feb 2, 2023
carmocca
force-pushed
the
xla_prediction
branch
from
February 2, 2023 17:28
cdb444d
to
9d07155
Compare
CI status: blocked by #16613 |
Merged
Borda
pushed a commit
that referenced
this pull request
Feb 9, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
Borda
pushed a commit
that referenced
this pull request
Feb 9, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
Borda
pushed a commit
that referenced
this pull request
Feb 9, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
Borda
pushed a commit
that referenced
this pull request
Feb 9, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
Borda
pushed a commit
that referenced
this pull request
Feb 9, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
lantiga
pushed a commit
that referenced
this pull request
Feb 10, 2023
Co-authored-by: Carlos Mocholí <[email protected]> (cherry picked from commit e20172d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
accelerator: tpu
Tensor Processing Unit
bug
Something isn't working
community
This PR is from the community
data handling
Generic data-related topic
fabric
lightning.fabric.Fabric
pl
Generic label for PyTorch Lightning package
ready
PRs ready to be merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Avoid wrapping dataloader with
MpDeviceLoader
more than once. Addbatch_sampler
back to the dataloader.What does this PR do?
Fixes #16572
When doing prediction on TPU with:
the code would crash because the prediction dataloader is wrapped twice with
MpDeviceLoader
, once inDataConnector._reset_eval_dataloader()
and once inPredictionLoop.advance()
.To avoid double wrapping, a checking is added in
TPUSpawnStrategy.process_dataloader()
.The
batch_sampler
is also added to the wrapped dataloader to avoid warning in prediction_epoch_loop.Does your PR introduce any breaking changes? If yes, please list them.
None
Before submitting
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:
Did you have fun?
Yes
Make sure you had fun coding 🙃