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

Fix inductor sub with symbolic integers. #108518

Closed
wants to merge 7 commits into from

Conversation

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 4, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 0dbfb94 with merge base db63bf3 (image):
💚 Looks good so far! There are no failures yet. 💚

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

ysiraichi added a commit that referenced this pull request Sep 4, 2023
Fix: #108159

ghstack-source-id: 6d86297a820863f9163c84f548f9b38d8e867e1f
Pull Request resolved: #108518
Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 4, 2023
Fix: #108159

ghstack-source-id: 8f0450feb7459eaafb086d5ab8f6fcba478606af
Pull Request resolved: #108518
…ers."

Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 4, 2023
Fix: #108159

ghstack-source-id: 73fc8bf6c885044b3e101040402d5ba683a442d7
Pull Request resolved: #108518
Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 4, 2023
Fix: #108159

ghstack-source-id: 5429ccab88bdc110381c7f040a98b39ddd9bb21d
Pull Request resolved: #108518
@@ -377,12 +377,23 @@ def inner(*inputs: List[TensorBox], alpha=None):
inputs[-1] = mul(inputs[-1], alpha)
else:
assert alpha is None

# Get the first TensorBox/ExpandView input as the reference tensor for
# sizes, data types, and device.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

promote_constants handles this for ir.Constant by wrapping it in an ExpandView:

ExpandView.create(
ir.Constant(x, ex.get_dtype(), ex.get_device()), list(ex.get_size())
)

I think we could just do the same for IndexingConstant below:

out.append(IndexingConstant(x, ex.get_dtype(), ex.get_device()))

Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 4, 2023
Fix: #108159

ghstack-source-id: 0a7d24b4bdb0c9280a8ce31d38138b7817e0cfdf
Pull Request resolved: #108518
@ysiraichi ysiraichi marked this pull request as draft September 5, 2023 20:42
Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 5, 2023
Fix: #108159

ghstack-source-id: 8cdbc02d862f247e9cbca293b5a5978569a18580
Pull Request resolved: #108518
out.append(
ExpandView.create(
ir.Constant(x, ex.get_dtype(), ex.get_device()), list(ex.get_size())
)
)
elif isinstance(x, sympy.Expr):
out.append(IndexingConstant(x, ex.get_dtype(), ex.get_device()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need to create an IndexingConstant node here, just wrap it in ExpandView.create.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Thanks for the help, @peterbell10.

ysiraichi added a commit that referenced this pull request Sep 6, 2023
Trying to re-land #108518.

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 6, 2023
Trying to re-land #108518.

ghstack-source-id: c8cfe27f2a7291cf73d5d77dc9d2cc8498656ef4
Pull Request resolved: #108647
Fix: #108159

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy ngimel yf225 chenyang78 kadeng muchulee8 aakhundov

[ghstack-poisoned]
ysiraichi added a commit that referenced this pull request Sep 6, 2023
Fix: #108159

ghstack-source-id: 8c7776bc84778e2f6543d1bcffd73c584b314738
Pull Request resolved: #108518
@ysiraichi ysiraichi marked this pull request as ready for review September 6, 2023 16:28
@ysiraichi
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 6, 2023
@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

@ysiraichi
Copy link
Collaborator Author

@pytorchbot merge

1 similar comment
@peterbell10
Copy link
Collaborator

@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

@facebook-github-bot facebook-github-bot deleted the gh/ysiraichi/83/head branch September 10, 2023 14:22
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.

None yet

4 participants