-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Update user-defined triton kernels tutorial with new torch.library.triton_op #3227
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3227
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…iton_op The new API is a more advanced complement to the existing APIs.
b409fec
to
c307876
Compare
# >>> y = mysin(x) | ||
|
||
###################################################################### | ||
# Limitations |
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.
Having this title be limitations, and then having two paragraphs of not-limitations is a bit weird
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.
Thanks, @zou3519! I added a few editorial suggestions.
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
…al.py Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py
Outdated
Show resolved
Hide resolved
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! We should wait for the 2.6 stable binaries to be available in main and merge into main (~ end of Jan).
def sin_triton(x): | ||
out = torch.empty_like(x) | ||
n_elements = x.numel() | ||
sin_kernel[(n_elements,)](x, out, n_elements, BLOCK_SIZE=4) | ||
return out |
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 guess this is the user-defined triton kernel w/ no @triton_op
? imo it would make sense to remove it (or add some context around it to indicate that this is the alternative where you don't use @triton_op
)
Should we land this? |
Will be landing everything on Friday and will provide links. |
The new API is a more advanced complement to the existing APIs.
cc @williamwen42 @msaroufim @anijain2305