-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[DataLoader] Select available CUDA or 3rd devices automatically to pin memory #125016
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125016
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 144a6e0 with merge base 769b1e6 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The committers listed above are authorized under a signed CLA. |
Would it be better to explicitly accept a |
This PR maintains BC in the parameters |
I'm deferring to @albanD for custom backend stuff |
Yes sorry, I wanted to give a longer answer on this but here is the short version:
What it means for this PR is a bit more subtle:
WDYT? |
@albanD
I plan to modify the new solution on this PR: #125122 |
I agree with you that additional |
Yes! But also note that most of these APIs do NOT have a device argument today. So not much to remove for most of them haha |
This PR improves the behavior for DataLoader when
pin_memory
isTrue
andpin_memory_device
is not set. Instead of only checking whether CUDA is available or not, a more reasonable approach is that first check available CUDA device, and if not, get privateuse1 backend automatically to pin memory to. Otherwise, throw some warnings that pin memory doesn't take effect.Fixes #124908
cc @ssnl @VitalyFedyunin @ejguan @dzhulgakov @ezyang