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
[AOTI] Delay the fallback kernel naming decision to the codegen time #113660
Conversation
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113660
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 93482e7 with merge base cebad98 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. ghstack-source-id: 07d4e9cd3d0d54be3d9b60520cfa0b3d0aaff7d3 Pull Request resolved: #113660
…degen time" Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. ghstack-source-id: b9b1aea254746656d1644a4c20a76ca87e3fc7e4 Pull Request resolved: #113660
…degen time" Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. ghstack-source-id: 566a03588604a84cc97f0ec85955e5069020a996 Pull Request resolved: #113660
…degen time" Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
@@ -4015,10 +4028,10 @@ def codegen(self, wrapper): | |||
wrapper.generate_scatter_fallback( | |||
x, | |||
[x, self.constant_args[0], index, src], | |||
self.kernel, | |||
self.cpp_kernel if V.graph.cpp_wrapper else self.kernel, |
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.
Can we call self.codegen_kernel_name
here?
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.
This is because codegen_kernel_name
doesn't exist in the base class ExternKernel
, since not all ExternKernel
has a kernel name. I think @int3 raised a similar question in a different context, codegen_kwargs
. I will create some other PRs to do some refactoring to the base/child classes here.
wrapper.writeline(wrapper.wrap_kernel_call(self.kernel, args)) | ||
wrapper.writeline( | ||
wrapper.wrap_kernel_call( | ||
self.cpp_kernel if V.graph.cpp_wrapper else self.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.
ditto - can we call self.codegen_kernel_name
?
@@ -4925,7 +4936,7 @@ def __init__( | |||
def codegen(self, wrapper): | |||
wrapper.generate_extern_kernel_alloc_and_find_schema_if_needed( | |||
self.get_name(), | |||
self.kernel, | |||
self.cpp_kernel if V.graph.cpp_wrapper else self.kernel, |
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.
ditto
@@ -3718,7 +3718,7 @@ def codegen(self, wrapper): | |||
self.output_view, | |||
self.codegen_reference(), | |||
args, | |||
self.kernel, | |||
self.cpp_kernel if V.graph.cpp_wrapper else self.kernel, |
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.
same
@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
LGTM. Thanks!
…degen time" Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler Differential Revision: [D51382677](https://our.internmc.facebook.com/intern/diff/D51382677) [ghstack-poisoned]
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. ghstack-source-id: af31f1e7a7928beef0b0f0b87c6fa9291321082a Pull Request resolved: #113660
@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…degen time" Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler Differential Revision: [D51382677](https://our.internmc.facebook.com/intern/diff/D51382677) [ghstack-poisoned]
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only. ghstack-source-id: bb7bce66e6389b927d2872016a760d082b995692 Pull Request resolved: #113660
@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
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):
Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler
Differential Revision: D51382677