-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Inductor respects strides for custom ops by default #126986
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
Previously, the default was that Inductor did not respect strides for all (builtin and custom) ops unless the op has a "needs_fixed_stride_order" tag on it. This PR changes it so that: - inductor doesn't respect strides for builtin ops. To change the behavior, one can add the "needs_fixed_stride_order" tag - inductor does respect strides for custom ops. To change the behavior, one can add the "does_not_need_fixed_stride_order" tag Test Plan: - new tests [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/126986
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 3e412f7 with merge base f0366de ( UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Previously, the default was that Inductor did not respect strides for all (builtin and custom) ops unless the op has a "needs_fixed_stride_order" tag on it. This PR changes it so that: - inductor doesn't respect strides for builtin ops. To change the behavior, one can add the "needs_fixed_stride_order" tag - inductor does respect strides for custom ops. To change the behavior, one can add the "does_not_need_fixed_stride_order" tag Test Plan: - new tests ghstack-source-id: cf25fd6 Pull Request resolved: #126986
ezyang
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.
The negation is kinda goofy but ok
albanD
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.
A bit sad that the changing default forces us to have 2 flags yeah.
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@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 |
Previously, the default was that Inductor did not respect strides for all (builtin and custom) ops unless the op has a "needs_fixed_stride_order" tag on it. This PR changes it so that: - inductor doesn't respect strides for builtin ops. To change the behavior, one can add the "needs_fixed_stride_order" tag - inductor does respect strides for custom ops. To change the behavior, one can add the "does_not_need_fixed_stride_order" tag Test Plan: - new tests Pull Request resolved: pytorch#126986 Approved by: https://github.com/ezyang, https://github.com/albanD
This reverts commit dd64ca2. There's a silent incorrectness bug with needs_fixed_stride_order=True and mutable custom ops, so it's better to flip the default back to avoid silent incorrectness. [ghstack-poisoned]
#127923) This reverts commit dd64ca2. There's a silent incorrectness bug with needs_fixed_stride_order=True and mutable custom ops, so it's better to flip the default back to avoid silent incorrectness. Pull Request resolved: #127923 Approved by: https://github.com/williamwen42
By default, Inductor is allowed to manipulate the layout (strides+storage offset) of input tensors to custom operators. We want to change it so that the default is that Inductor should respect the stride order of input tensors to custom operators. This PR adds a config to toggle the behavior, in the next PR up we'll change the default. We also make the following changes: - We add a new operator Tag (flexible_layout), which means that inductor is allowed to manipulate the layout. When we flip the default, users can specify they want the old behavior by using this tag. This is a reland of #126986, which was previously reverted due to silent incorrectness. We've since fixed the silent incorrectness (#133639) Test Plan: - new test [ghstack-poisoned]
By default, Inductor is allowed to manipulate the layout (strides+storage offset) of input tensors to custom operators. We want to change it so that the default is that Inductor should respect the stride order of input tensors to custom operators. This PR adds a config to toggle the behavior, in the next PR up we'll change the default. We also make the following changes: - We add a new operator Tag (flexible_layout), which means that inductor is allowed to manipulate the layout. When we flip the default, users can specify they want the old behavior by using this tag. This is a reland of #126986, which was previously reverted due to silent incorrectness. We've since fixed the silent incorrectness (#133639) Test Plan: - new test Pull Request resolved: #135238 Approved by: https://github.com/albanD
By default, Inductor is allowed to manipulate the layout (strides+storage offset) of input tensors to custom operators. We want to change it so that the default is that Inductor should respect the stride order of input tensors to custom operators. This PR adds a config to toggle the behavior, in the next PR up we'll change the default. We also make the following changes: - We add a new operator Tag (flexible_layout), which means that inductor is allowed to manipulate the layout. When we flip the default, users can specify they want the old behavior by using this tag. This is a reland of pytorch/pytorch#126986, which was previously reverted due to silent incorrectness. We've since fixed the silent incorrectness (pytorch/pytorch#133639) Test Plan: - new test ghstack-source-id: ce6c52d Pull Request resolved: pytorch/pytorch#135238
By default, Inductor is allowed to manipulate the layout (strides+storage offset) of input tensors to custom operators. We want to change it so that the default is that Inductor should respect the stride order of input tensors to custom operators. This PR adds a config to toggle the behavior, in the next PR up we'll change the default. We also make the following changes: - We add a new operator Tag (flexible_layout), which means that inductor is allowed to manipulate the layout. When we flip the default, users can specify they want the old behavior by using this tag. This is a reland of pytorch#126986, which was previously reverted due to silent incorrectness. We've since fixed the silent incorrectness (pytorch#133639) Test Plan: - new test Pull Request resolved: pytorch#135238 Approved by: https://github.com/albanD
Stack from ghstack (oldest at bottom):
Previously, the default was that Inductor did not respect strides for
all (builtin and custom) ops unless the op has a
"needs_fixed_stride_order" tag on it. This PR changes it so that:
behavior, one can add the "needs_fixed_stride_order" tag
one can add the "does_not_need_fixed_stride_order" tag
Test Plan:
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang