Skip to content

Conversation

@zou3519
Copy link
Contributor

@zou3519 zou3519 commented May 23, 2024

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:

  • 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

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang

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]
@zou3519 zou3519 requested a review from ezyang as a code owner May 23, 2024 17:18
@pytorch-bot
Copy link

pytorch-bot bot commented May 23, 2024

🔗 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 (image):

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.

zou3519 added a commit that referenced this pull request May 23, 2024
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
@zou3519 zou3519 requested review from Chillee, albanD and eellison May 23, 2024 18:00
Copy link
Contributor

@ezyang ezyang left a 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

@zou3519 zou3519 added the ciflow/trunk Trigger trunk jobs on your pull request label May 23, 2024
Copy link
Collaborator

@albanD albanD left a 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.

@zou3519
Copy link
Contributor Author

zou3519 commented May 24, 2024

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@zou3519
Copy link
Contributor Author

zou3519 commented May 24, 2024

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

titaiwangms pushed a commit to titaiwangms/pytorch that referenced this pull request May 28, 2024
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
zou3519 added a commit that referenced this pull request Jun 4, 2024
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]
zou3519 added a commit that referenced this pull request Jun 4, 2024
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-source-id: bae5a51
Pull Request resolved: #127923
pytorchmergebot pushed a commit that referenced this pull request Jun 4, 2024
#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
@github-actions github-actions bot deleted the gh/zou3519/989/head branch June 25, 2024 01:54
zou3519 added a commit that referenced this pull request Sep 5, 2024
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]
pytorchmergebot pushed a commit that referenced this pull request Sep 6, 2024
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
enter-ctrl9 pushed a commit to enter-ctrl9/pytorch11 that referenced this pull request Sep 15, 2024
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
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants