-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Add torch.compile support for torch.mm(out_dtype=...) #159026
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159026
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 381da56 with merge base ee4c5c7 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
c18ea69
to
e8af708
Compare
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.
Nice!
Test failures are real, looks like those functions need to be added to aoti shim? |
@@ -2421,6 +2421,19 @@ def meta_mm(a, b): | |||
return a.new_empty(N, P) | |||
|
|||
|
|||
@register_meta(aten.mm.dtype) | |||
def meta_mm_dtype(a, b, out_dtype): |
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.
Shouldn't there also be check that an and b are on the same device or is that not necessary? (Seems like other metas need that check anyway)
e8af708
to
457b296
Compare
2a1d938
to
346c820
Compare
@desertfire can you help with aoti? Right now we are skipping a test but ideally we'd like to make sure that it's handled correctly |
7b44e0c
to
381da56
Compare
@desertfire for more context: I tried adding Wonder is there a way to register custom C++ kernel names in the fallback_ops.py ? |
@@ -570,6 +570,13 @@ def lazy_register_extern_choice(fn): | |||
|
|||
aten_mm = ExternKernelChoice(torch.mm, "at::mm_out") | |||
|
|||
aten_mm_dtype = ExternKernelChoice( | |||
torch.mm, | |||
"at::_mm_dtype_out_cuda", |
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.
"at::_mm_dtype_out_cuda", | |
"at::mm_dtype_out", |
This will make cpp_wrapper/AOTI happy.
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.
And you need to bring back your change to fallback_ops.py
.
Fixes #159023.
Original comment: pytorch/helion#339 (comment).
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben