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

[AOTI] Delay the fallback kernel naming decision to the codegen time #113660

Closed
wants to merge 6 commits into from

Conversation

desertfire
Copy link
Contributor

@desertfire desertfire commented Nov 14, 2023

Summary: This is to prepare for a later change that changes AOTI's second-pass to perform codegen only.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Nov 14, 2023

🔗 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 Failures

As of commit 93482e7 with merge base cebad98 (image):
💚 Looks good so far! There are no failures yet. 💚

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

desertfire added a commit that referenced this pull request Nov 14, 2023
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]
desertfire added a commit that referenced this pull request Nov 14, 2023
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]
desertfire added a commit that referenced this pull request Nov 14, 2023
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
@desertfire desertfire added the topic: not user facing topic category label Nov 14, 2023
…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,
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@desertfire
Copy link
Contributor Author

@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@chenyang78 chenyang78 left a 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]
desertfire added a commit that referenced this pull request Nov 16, 2023
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
Copy link
Contributor Author

@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]
desertfire added a commit that referenced this pull request Nov 16, 2023
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
Copy link
Contributor Author

@desertfire has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants