-
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
Fix moving keys to device in ResultCollection #19814
Fix moving keys to device in ResultCollection #19814
Conversation
99dcf93
to
3db5c52
Compare
Please check if you have a chance, @awaelchli |
3db5c52
to
8085e74
Compare
Could you please check this bug, @Borda? |
I would appreciate if you can check this PR, @awaelchli. Thanks! |
@clumsy with these small adjustments I commented on, this would be ready to land. I can also make the changes if you don't have time. Anyway, sorry for the delay. |
278d44e
to
1dfbe7d
Compare
for more information, see https://pre-commit.ci
The assertion was referencing the variable before the object was moved to device
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #19814 +/- ##
=========================================
- Coverage 89% 81% -8%
=========================================
Files 266 263 -3
Lines 22976 22920 -56
=========================================
- Hits 20522 18556 -1966
- Misses 2454 4364 +1910 |
Great fix, thanks @clumsy! |
Co-authored-by: Alexander Jipa <azzhipa@amazon.com>
What does this PR do?
Move registered results' keys to the current device. Otherwise internal tensors like
cumulated_batch_size
will stay oncpu
after they are moved there in previous call toteardown()
.Removing standalone
register_key()
method because it's not used outside of this module and we either end up calling.to()
twice or might need to require the potential users to call it themselves.Fixes #19813
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:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--19814.org.readthedocs.build/en/19814/