-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[train] set auto_transfer cuda device #26819
Conversation
Signed-off-by: Matthew Deng <[email protected]>
Hi @matthewdeng , could u print out the cuda memory? https://discuss.pytorch.org/t/how-to-check-the-gpu-memory-being-used/131220 say cuda_mem = [torch.cuda.memory_allocated(i)/1024/1024/1024) for i in range(4)]
assert min(cuda_mem) == max(cuda_mem) and cuda_memo[0] > 0 |
this feature is coool 🚀 |
i mean in the first case cuda_memo[0] = 4x1281, cuda_memo[1] = 0, .... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is a great find!
Do you think we should treat this optimization as experimental and disable by default until we can more rigorously test it?
Signed-off-by: Matthew Deng <[email protected]>
@amogkam hah I was actually thinking the same thing, updated! |
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - this should solve the benchmark script GPU util issue, right?
This sets the CUDA Stream on the correct device (and not the default one) when calling train.torch.prepare_data_loader(auto_transfer=True). Signed-off-by: Matthew Deng <[email protected]> Signed-off-by: Rohan138 <[email protected]>
This sets the CUDA Stream on the correct device (and not the default one) when calling train.torch.prepare_data_loader(auto_transfer=True). Signed-off-by: Matthew Deng <[email protected]> Signed-off-by: Stefan van der Kleij <[email protected]>
Signed-off-by: Matthew Deng [email protected]
Why are these changes needed?
This sets the CUDA Stream on the correct device (and not the default one) when calling
train.torch.prepare_data_loader(auto_transfer=True)
.Repro
Before:
After:
Related issue number
Closes #26707
Checks
scripts/format.sh
to lint the changes in this PR.