-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix to keep stride in return_and_correct_aliasing() #117860
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/117860
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 2ff2303 with merge base 26fbbc3 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 TODO: investigate why the fix trips the assert mentioned in the issue [ghstack-poisoned]
Fixes #117794 Fix tripped the assert here: https://github.com/pytorch/pytorch/blob/86dedebeafdd7b08d21432cebd7538437d3b7509/torch/utils/_python_dispatch.py#L216 From investigation: I found that functionalization of an in-place op (`mul_` in this test case) results in the strides of `TwoTensor`'s `a` / `b` components being mutated to be contiguous. This is not reflected in the outer tensor, causing the assert to be tripped. To address this, I set the `dispatch_sizes_strides_policy` of `TwoTensor` so that sizes / strides / storage offset are always queried from the underlying components. Now the stride mutation of the inner tensors due to functionalization is properly reflected in the outer tensor. This seems like a broader issue affecting subclasses whose sizes / strides are dependent on those of the inner tensors; for these to work properly with functionalization / PT2 as a whole, they probably want to follow this `dispatch_sizes_strides_policy="sizes"` pattern. [ghstack-poisoned]
Fixes #117794 Fix tripped the assert here: https://github.com/pytorch/pytorch/blob/86dedebeafdd7b08d21432cebd7538437d3b7509/torch/utils/_python_dispatch.py#L216 From investigation: I found that functionalization of an in-place op (`mul_` in this test case) results in the strides of `TwoTensor`'s `a` / `b` components being mutated to be contiguous. This is not reflected in the outer tensor, causing the assert to be tripped. After discussion with Brian, I address this by disallowing input mutations on non-contiguous tensor subclass inputs for now. [ghstack-poisoned]
Fixes #117794 Fix tripped the assert here: https://github.com/pytorch/pytorch/blob/86dedebeafdd7b08d21432cebd7538437d3b7509/torch/utils/_python_dispatch.py#L216 From investigation: I found that functionalization of an in-place op (`mul_` in this test case) results in the strides of `TwoTensor`'s `a` / `b` components being mutated to be contiguous. This is not reflected in the outer tensor, causing the assert to be tripped. After discussion with Brian, I address this in this PR by disallowing input mutations on non-contiguous tensor subclass inputs for now. [ghstack-poisoned]
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!
@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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@pytorchbot merge -f "ignore pre-existing failure" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
@davidberard98 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Stack from ghstack (oldest at bottom):
Fixes #117794
Fix tripped the assert here:
pytorch/torch/utils/_python_dispatch.py
Line 216 in 86dedeb
From investigation: I found that functionalization of an in-place op (
mul_
in this test case) results in the strides ofTwoTensor
'sa
/b
components being mutated to be contiguous. This is not reflected in the outer tensor, causing the assert to be tripped.After discussion with Brian, I address this in this PR by disallowing input mutations on non-contiguous tensor subclass inputs for now.
Differential Revision: D54214617