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

Improve custom ops tutorials #3020

Merged
merged 2 commits into from
Aug 29, 2024
Merged

Improve custom ops tutorials #3020

merged 2 commits into from
Aug 29, 2024

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Aug 28, 2024

Fixes pytorch/pytorch#133318

Description

We update the custom ops tutorials based on user feedback.

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

Copy link

pytorch-bot bot commented Aug 28, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3020

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 0310be6 with merge base fc016bd (image):
💚 Looks good so far! There are no failures yet. 💚

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

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 - jus a couple of minor nits

advanced_source/cpp_custom_ops.rst Outdated Show resolved Hide resolved
@@ -174,6 +174,8 @@ To add ``torch.compile`` support for an operator, we must add a FakeTensor kerne
known as a "meta kernel" or "abstract impl"). FakeTensors are Tensors that have
metadata (such as shape, dtype, device) but no data: the FakeTensor kernel for an
operator specifies how to compute the metadata of output tensors given the metadata of input tensors.
The FakeTensor kernel should return return dummy Tensors of your choice with
the correct Tensor metadata (shape/strides/``dtype``/device).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in double ticks?

Suggested change
the correct Tensor metadata (shape/strides/``dtype``/device).
the correct Tensor metadata (``shape/strides/<dtype>/device``).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just wanted to put dtype in double ticks because it's not an english word

@svekars svekars added the module: custom-operators PRs related to custom ops tutorials label Aug 28, 2024
@zou3519 zou3519 merged commit 4cb73ca into main Aug 29, 2024
19 checks passed
@zou3519 zou3519 deleted the rzou/improve_custom_ops branch August 29, 2024 14:05
c-p-i-o pushed a commit that referenced this pull request Sep 6, 2024
Co-authored-by: Svetlana Karslioglu <[email protected]>
c-p-i-o pushed a commit that referenced this pull request Sep 6, 2024
Co-authored-by: Svetlana Karslioglu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed module: custom-operators PRs related to custom ops tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update python custom ops tutorial per user feedback
3 participants