-
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 non-blocking GPU->CPU copies. #11288
Merged
carmocca
merged 5 commits into
Lightning-AI:master
from
edpizzi:fix_11287_non_blocking_copy_to_cpu
Jan 3, 2022
Merged
Avoid non-blocking GPU->CPU copies. #11288
carmocca
merged 5 commits into
Lightning-AI:master
from
edpizzi:fix_11287_non_blocking_copy_to_cpu
Jan 3, 2022
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
edpizzi
force-pushed
the
fix_11287_non_blocking_copy_to_cpu
branch
from
January 1, 2022 23:01
685b053
to
61ff6a4
Compare
edpizzi
requested review from
awaelchli,
Borda,
carmocca,
justusschock,
kaushikb11,
rohitgr7,
SeanNaren,
tchaton and
williamFalcon
as code owners
January 2, 2022 07:16
justusschock
approved these changes
Jan 3, 2022
rohitgr7
approved these changes
Jan 3, 2022
Borda
approved these changes
Jan 3, 2022
awaelchli
approved these changes
Jan 3, 2022
Non-blocking GPU->CPU transfers can create race windows where tensor contents are observed to have incorrect values. Lightning-AI#11287
Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]>
edpizzi
force-pushed
the
fix_11287_non_blocking_copy_to_cpu
branch
from
January 3, 2022 17:27
43caaa8
to
6ca1018
Compare
carmocca
approved these changes
Jan 3, 2022
rohitgr7
added a commit
that referenced
this pull request
Jan 4, 2022
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
awaelchli
added a commit
that referenced
this pull request
Jan 4, 2022
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
awaelchli
added a commit
that referenced
this pull request
Jan 5, 2022
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
awaelchli
added a commit
that referenced
this pull request
Jan 5, 2022
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
lexierule
pushed a commit
that referenced
this pull request
Jan 5, 2022
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Justus Schock <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Non-blocking GPU->CPU transfers can create race windows where tensor contents are observed to have incorrect values.
Fixes #11287. See #11287 for detailed mechanics of the issue this resolves.
Verified that this change fixes the behavior in the reproduce script from #11287.
Does your PR introduce any breaking changes? If yes, please list them.
No
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Fixing: yes. Root causing the bug: no. It's subtle, and many log statements you add to debug the issue fix the issue (by observing the value of GPU tensors, forcing a CUDA sync), which is frustrating if you don't know that this is the nature of the issue.
I also had some trouble getting tests to run in my environment. It looks to me like some tests fail in GPU environments but pass in non-GPU environments. Others fail when run on slurm environments, which is the only way I can easily access GPUs.