Skip to content
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

Refactor layout constraint selection logic #148104

Open
wants to merge 12 commits into
base: gh/zou3519/1145/base
Choose a base branch
from

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Feb 27, 2025

Stack from ghstack (oldest at bottom):

This PR:

  • cleans up some existing comments that don't make sense anymore
  • hooks up the "custom_op_default_layout_constraint" back (that seems to
    have broken)
  • cleans up the "lazy registration path" which seems to never get hit
    anymore
  • adds dislike_padding to nodes that require exact strides

Test Plan:

  • tests + CI

disable padding

cc @ezyang @SherlockNoMad @EikanWang @jgong5 @wenzhe-nrv @voznesenskym @penguinwu @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov

If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Feb 27, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/148104

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 5b2e7c7 with merge base 58ede0c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

zou3519 added a commit that referenced this pull request Feb 27, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

ghstack-source-id: 783f234998b49836198994f21265c9a6379c1347
Pull Request resolved: #148104
@zou3519 zou3519 added the keep-going Don't stop on first failure, keep running tests until the end label Feb 27, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Feb 27, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

ghstack-source-id: 783f234998b49836198994f21265c9a6379c1347
Pull Request resolved: #148104
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Feb 27, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

ghstack-source-id: fe56f431c57db7901148780fca1f3f341fc5b1ae
Pull Request resolved: #148104
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
shunting314 added a commit that referenced this pull request Mar 4, 2025
Fix #148356 

This is some sort of short term fix to recover the default behavior to apply layout constraint for custom ops when there are no tags.

A longer term attempt to make sure Inductor always gets correct eager strides is here: #148104

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

[ghstack-poisoned]
shunting314 added a commit that referenced this pull request Mar 4, 2025
Fix #148356 

This is some sort of short term fix to recover the default behavior to apply layout constraint for custom ops when there are no tags.

A longer term attempt to make sure Inductor always gets correct eager strides is here: #148104

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

[ghstack-poisoned]
shunting314 added a commit that referenced this pull request Mar 4, 2025
Fix #148356 

This is some sort of short term fix to recover the default behavior to apply layout constraint for custom ops when there are no tags.

A longer term attempt to make sure Inductor always gets correct eager strides is here: #148104

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

[ghstack-poisoned]
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Mar 5, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

ghstack-source-id: 897e8455195de633b150ad3550e8a57b57c31b64
Pull Request resolved: #148104
pytorchmergebot pushed a commit that referenced this pull request Mar 6, 2025
Fix #148356

This is some sort of short term fix to recover the default behavior to apply layout constraint for custom ops when there are no tags.

A longer term attempt to make sure Inductor always gets correct eager strides is here: #148104

Pull Request resolved: #148367
Approved by: https://github.com/eellison, https://github.com/zou3519
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

[ghstack-poisoned]
zou3519 added a commit that referenced this pull request Mar 6, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

ghstack-source-id: ca7cb9176f4c13d3b195b5a2b32695ebba4d15fe
Pull Request resolved: #148104
Copy link

linux-foundation-easycla bot commented Mar 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@zou3519 zou3519 mentioned this pull request Mar 6, 2025
zou3519 added 2 commits April 1, 2025 21:15
Significant cleanup of the code (it has gotten bad over time).
This PR:
- does some deduplication
- cleans up the "lazy registration path" which seems to never get hit
  anymore...

Test Plan:
- tests + CI

[ghstack-poisoned]
This PR:
- cleans up some existing comments that don't make sense anymore
- hooks up the "custom_op_default_layout_constraint" back (that seems to
  have broken)
- cleans up the "lazy registration path" which seems to never get hit
  anymore

Test Plan:
- tests + CI

[ghstack-poisoned]
@zou3519 zou3519 requested review from eellison and shunting314 April 2, 2025 13:30
@zou3519 zou3519 added the topic: not user facing topic category label Apr 2, 2025
This PR:

- cleans up some existing comments that don't make sense anymore
- hooks up the "custom_op_default_layout_constraint" back (that seems to
have broken)
- cleans up the "lazy registration path" which seems to never get hit
anymore
- adds dislike_padding to nodes that require exact strides

Test Plan:
- tests + CI

disable padding

[ghstack-poisoned]
This PR:

- cleans up some existing comments that don't make sense anymore
- hooks up the "custom_op_default_layout_constraint" back (that seems to
have broken)
- cleans up the "lazy registration path" which seems to never get hit
anymore
- adds dislike_padding to nodes that require exact strides

Test Plan:
- tests + CI

disable padding

[ghstack-poisoned]
@zou3519 zou3519 added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 8, 2025
@zou3519
Copy link
Contributor Author

zou3519 commented Apr 9, 2025

@pytorchbot merge -f "macos infinite queue"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

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

@laithsakka
Copy link
Contributor

laithsakka commented Apr 9, 2025

FYI: this PR adds a slight regression <1% to most benchmarks which is ok
Screenshot 2025-04-09 at 9 07 13 AM

pytorchmergebot pushed a commit that referenced this pull request Apr 9, 2025
If a tag is not specified on a custom operator, then inductor will
assume that it needs exact strides.

Test Plan:
- tests + CI

Pull Request resolved: #150511
Approved by: https://github.com/eellison, https://github.com/shunting314
ghstack dependencies: #150495, #148104
@atalman
Copy link
Contributor

atalman commented Apr 9, 2025

@pytorchmergebot -c nosignal -m "GH job link HUD commit link"

Copy link

pytorch-bot bot commented Apr 9, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'nosignal' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'cherry-pick', 'close')

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

@atalman
Copy link
Contributor

atalman commented Apr 9, 2025

@pytorchmergebot revert -c nosignal -m "GH job link HUD commit link"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@zou3519 your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td Do not run TD on this PR ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fx keep-going Don't stop on first failure, keep running tests until the end Merged module: dynamo module: inductor release notes: fx release notes category Reverted topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants