-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix cuda sanitizer and as_subclass calls #138218
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138218
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3d6e927 with merge base 20af56d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| # different state of already cleaned up. | ||
| # Similarly other imports might already have been cleaned up so `sys` might | ||
| # be already gone as well. | ||
| # Skip exiting the mode if it outlived the runtime. |
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.
If we don't exit the mode, do we expect anything bad to happen? Or is it more like: the runtime is gone, sys is gone, exiting the mode is not a concern as everything is gone?
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.
Exactly !
| csan.enable_cuda_sanitizer() | ||
| t = TwoTensor(torch.rand(2), torch.rand(2)) | ||
|
|
||
| t = MyT(torch.rand(2)) |
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.
I don't understand how this test case would have failed before. It looks like we expected a race for creating two different subclasses ?
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.
No just two different kind of subclass should work.
Skylion007
left a comment
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.
Fix
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This fixes 4 main issues:
Tensor.as_sublass()to properly disable modes when creating the new Tensor object just like we already do inmake_subclassandmake_wrapper_subclass. The change here is just to apply the exact same treatment to it.FixWe have test that check that this behavior happen so I guess this is not an obvious bugfix and expected behavior. Reverted that change.Tensor.as_subclass()not to propagate autograd as there is no valid backward associated here.