-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[aotinductor] support at::convolution for AOTInductor #114961
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
This PR adds support to at::convolution for AOTInductor [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/114961
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 938b8c6 with merge base af5a3bd ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| }); | ||
| } | ||
|
|
||
| AOTI_TORCH_EXPORT AOTITorchError aoti_torch_convolution( |
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.
Would it make sense to codegen these ?
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.
Yeah, I think we rely on both codegen and at::convolution extern call, depending on the profiling results:
https://github.com/pytorch/pytorch/blob/main/torch/_inductor/kernel/conv.py#L411-L413
To support the extern call case, we need to include this into the C shim.
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.
I think @eellison meant auto-generating shim functions. There were not many interfaces needed initially. Hopefully with more complete decomposition coverage, MM and Conv are the only cases we need to have in the C shim layer.
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.
I see. Yeah, we would definitely go for that direction if we see lots of shim functions.
This PR adds support to at::convolution for AOTInductor cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
| }); | ||
| } | ||
|
|
||
| AOTI_TORCH_EXPORT AOTITorchError aoti_torch_convolution( |
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.
I think @eellison meant auto-generating shim functions. There were not many interfaces needed initially. Hopefully with more complete decomposition coverage, MM and Conv are the only cases we need to have in the C shim layer.
| self.writeline(f"AOTI_TORCH_ERROR_CODE_CHECK({shim_fn}({', '.join(args)}));") | ||
|
|
||
| def generate_c_shim_extern_kernel_alloc_call(self, extern_kernel, args): | ||
| def generate_c_shim_extern_kernel_alloc(self, extern_kernel, args): |
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.
We could use some refactoring for ir.ExternKernelAlloc and ir.FallbackKernel at some point.
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.
We could use some refactoring for
ir.ExternKernelAllocandir.FallbackKernelat some point.
Yeah, agreed.
| int64_t padding_size, | ||
| int64_t* dilation_ptr, | ||
| int64_t dilation_size, | ||
| bool transposed, |
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.
use int instead
This PR adds support to at::convolution for AOTInductor cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
This PR adds support to at::convolution for AOTInductor cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 kadeng muchulee8 aakhundov ColinPeppler [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 |
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 |
| int64_t* stride_ptr, | ||
| int64_t stride_size, | ||
| int64_t* padding_ptr, | ||
| int64_t padding_size, | ||
| int64_t* dilation_ptr, | ||
| int64_t dilation_size, | ||
| int transposed, | ||
| int64_t* output_padding_ptr, |
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.
I think all these pointers needed to be decorated with const. piggybacking fix onto #113577
This PR adds support to at::convolution for AOTInductor Pull Request resolved: pytorch#114961 Approved by: https://github.com/desertfire
Stack from ghstack (oldest at bottom):
This PR adds support to at::convolution for AOTInductor
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @kadeng @muchulee8 @aakhundov @ColinPeppler