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

Recommend cpython agnosticism in cpp custom op tutorial #3250

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

janeyx99
Copy link
Contributor

@janeyx99 janeyx99 commented Jan 22, 2025

Description

In 2.6, PyTorch will better support python agnosticism in custom operators. This PR updates the tutorial to recommend the torch.ops.load_library path so that future custom op writers can follow this better pattern instead. These changes are paired with updates to our example extension-cpp repo that have now landed: pytorch/extension-cpp#105

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 Jan 22, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7b1ab2c with merge base 15ef015 (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.

Minor editorial nits.

advanced_source/cpp_custom_ops.rst Outdated Show resolved Hide resolved
advanced_source/cpp_custom_ops.rst Outdated Show resolved Hide resolved
advanced_source/cpp_custom_ops.rst Outdated Show resolved Hide resolved
@janeyx99 janeyx99 changed the title Recommend python agnosticism in cpp custom op tutorial Recommend cpython agnosticism in cpp custom op tutorial Jan 24, 2025
Comment on lines 118 to 119
This ``setup`` would build one wheel that could be installed across multiple CPython
versions ``>=3.9``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Uh, does the wheel have the right platform tags to reject Python 3.8? Or is the advice to people to always use the smallest version that is not deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the latter hehe

i haven't checked against 3.8, but it was cuz i chose 3.9 as the min version out there. will include a sentence for that

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah we need to tell people that the numbers they choose should be the min version pytorch supports

@janeyx99 janeyx99 force-pushed the python-agnostic-1st branch from 9e388d2 to 1372553 Compare January 27, 2025 16:17
@janeyx99 janeyx99 merged commit b76570d into main Jan 28, 2025
20 checks passed
@janeyx99 janeyx99 deleted the python-agnostic-1st branch January 28, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants