Skip to content

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

Merged
merged 21 commits into from
Jan 24, 2025

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Jan 10, 2025

The new API is a more advanced complement to the existing APIs.

cc @williamwen42 @msaroufim @anijain2305

Copy link

pytorch-bot bot commented Jan 10, 2025

🔗 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.
# >>> y = mysin(x)

######################################################################
# Limitations
Copy link
Contributor

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

@svekars svekars added the 2.6 Tracking 2.6 version PRs. label Jan 10, 2025
Copy link
Contributor

@svekars svekars left a 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.

@svekars svekars changed the base branch from main to 2.6-RC-TEST January 10, 2025 18:09
@svekars svekars added the torch.compile Torch compile and other relevant tutorials label Jan 13, 2025
zou3519 and others added 16 commits January 13, 2025 14:34
…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>
Copy link
Contributor

@svekars svekars left a 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).

Comment on lines +230 to +234
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
Copy link
Contributor

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)

@kit1980
Copy link
Contributor

kit1980 commented Jan 23, 2025

Should we land this?
I'd want to link to this in the 2.6 release blog.

@svekars
Copy link
Contributor

svekars commented Jan 23, 2025

Will be landing everything on Friday and will provide links.

@svekars svekars changed the base branch from 2.6-RC-TEST to main January 24, 2025 18:23
@svekars svekars merged commit c27636a into main Jan 24, 2025
17 of 18 checks passed
@svekars svekars deleted the update_triton branch January 24, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6 Tracking 2.6 version PRs. cla signed torch.compile Torch compile and other relevant tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants