-
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
Add torch.cuda rng state to seed save/load #14384
Conversation
I believe these arent part of the torch `default_generator` `.set_state()` and `.get_state()` (C implementation [here](https://github.com/pytorch/pytorch/blob/master/torch/csrc/Generator.cpp))
for more information, see https://pre-commit.ci
Only issue I can come up with if cuda is not available, torch.cuda returns None? |
Codecov Report
@@ Coverage Diff @@
## master #14384 +/- ##
=========================================
+ Coverage 61% 76% +15%
=========================================
Files 332 332
Lines 26848 26892 +44
=========================================
+ Hits 16419 20430 +4011
+ Misses 10429 6462 -3967 |
Updated the test and did some interactive testing, ready for review. If torch is not compiled with cuda, torch.cuda.get/set.. doesnt run into any error. On the test side, |
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.
Great!
Could you also add a changelog entry? <3 |
Done! |
for more information, see https://pre-commit.ci
Head branch was pushed to by a user without write access
What does this PR do?
Add torch.cuda rng state to the default seed save/load functionality:
torch.get/set_rng_state()
does not includetorch.cuda
* andtorch.cuda
rng is not reset* Presumably cause
torch.cuda
is not included in the torchdefault_generator
.set_state()
and.get_state()
(C implementation here)Fixes #UNKNOWN
Does your PR introduce any breaking changes? If yes, please list them.
Not aware
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 LIGHTNING IS AWESOME ⚡
Make sure you had fun coding 🙃