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
Conversation
Fix: #108159 [ghstack-poisoned]
🔗 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 FailuresAs of commit 0dbfb94 with merge base db63bf3 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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]
…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]
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]
torch/_inductor/lowering.py
Outdated
@@ -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. |
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.
promote_constants
handles this for ir.Constant
by wrapping it in an ExpandView
:
pytorch/torch/_inductor/lowering.py
Lines 351 to 353 in 51c2e22
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:
pytorch/torch/_inductor/lowering.py
Line 356 in 51c2e22
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]
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]
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())) |
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.
You still need to create an IndexingConstant
node here, just wrap it in ExpandView.create
.
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.
Oh, I see. Thanks for the help, @peterbell10.
Trying to re-land #108518. [ghstack-poisoned]
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]
@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 |
1 similar comment
@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 |
Stack from ghstack (oldest at bottom):
sub
with symbolic integers. #108518Fix: #108159
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov