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

Add pageable/pinned tensor to cuda reliability note in pinmem tutorial #3261

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

vmoens
Copy link
Contributor

@vmoens vmoens commented Jan 24, 2025

Adds some more info on when it is unsafe to use non_blocking (namely with pinned tensors)

cc @nairbv

Copy link

pytorch-bot bot commented Jan 24, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3261

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a019acb with merge base 13d365c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@vmoens vmoens force-pushed the add-pin-mem-caveat branch 2 times, most recently from efb8e51 to a707b7f Compare January 24, 2025 20:51
@svekars svekars added the rl Issues related to reinforcement learning tutorial, DQN, and so on label Jan 27, 2025
# However, in other cases we cannot make the same asusmption: when a tensor is placed in pinned memory, mutating the
# original copy after calling the host-to-device transfer may corrupt the data received on GPU.
# Similarly, when a transfer is achieved in the opposite direction, from GPU to CPU, or from any device that is not CPU
# or GPU to any device that is not a CUDA-handled GPU (e.g., MPS), there is no guarantee that the data read on GPU is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# or GPU to any device that is not a CUDA-handled GPU (e.g., MPS), there is no guarantee that the data read on GPU is
# or GPU to any device that is not a CUDA-handled GPU (such as, MPS), there is no guarantee that the data read on GPU is

@vmoens vmoens force-pushed the add-pin-mem-caveat branch from b612d61 to a019acb Compare February 18, 2025 18:12
@vmoens
Copy link
Contributor Author

vmoens commented Feb 18, 2025

@svekars I corrected the spelling - should be good for final review

@vmoens vmoens merged commit 1cedb08 into main Feb 19, 2025
20 checks passed
@vmoens vmoens deleted the add-pin-mem-caveat branch February 19, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed rl Issues related to reinforcement learning tutorial, DQN, and so on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants