-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Triton Kernel Rejects NamedTupleVariable Arguments #148289
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
Comments
Looks like schemas cannot support tuples which is pretty frustrating restriction here: pytorch/torch/_library/infer_schema.py Line 135 in 29c2de9
|
@cora-codes does triton support named tuple arguments without torch.compile? It did not used to, not sure whether this changed. @zou3519 ^ |
Yes, Triton supports named tuple arguments now. See: triton-lang/triton#5518 |
Yep, this is very new and is in fact newer than the PyTorch compatible Triton version: https://github.com/pytorch/pytorch/blob/main/.ci/docker/triton_version.txt |
Understood. This is why I'm asking for it as a feature rather than saying it should be treated like a bug 😅 . I think this addition makes Triton kernels so much cleaner - you can pass in strides, shapes far easier than before etc |
named tuples in Dynamo/fx are a little wild (cc @StrongerXi) but the request has been heard. @StrongerXi we should bring back the namedtuple PR |
@cora-codes could you try and see if #147145 fixes the issue. |
@StrongerXi I tried it with #147145 ( |
cc @davidberard98 too |
Would dataclasses be easier to support than namedtuples? |
🚀 The feature, motivation and pitch
PyTorch's TorchDynamo fails when passing NamedTupleVariable to Triton kernels, raising "Unexpected argument type for a Triton kernel". It would be nice to support named tuple arguments since it makes writing Triton kernels far cleaner.
Alternatives
No response
Additional context
No response
cc @ezyang @SherlockNoMad @EikanWang @jgong5 @wenzhe-nrv @chauhang @penguinwu @voznesenskym @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @jiayisunx @chenyang78 @kadeng @amjames @oulgen @aakhundov @davidberard98
The text was updated successfully, but these errors were encountered: