-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Update Custom C++ and CUDA Operators to use PyTorch stable API/ABI #3701
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3701
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 2 PendingAs of commit 919d88d with merge base 10eefc3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
479f1c2 to
a8c5294
Compare
| Use ``torch.library.register_autograd`` to add training support for an operator. Prefer | ||
| this over directly using Python ``torch.autograd.Function`` or C++ ``torch::autograd::Function``; | ||
| you must use those in a very specific way to avoid silent incorrectness (see | ||
| this over directly using Python ``torch.autograd.Function`` (see |
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.
remove reference to torch::autograd::Function since we don't support that in stable API/ABI
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 get that you want to push the new stable abi APIs, but I do want the tutorial to read well for both stable abi APIs and the old non-abi-stable APIs. Right now the tutorial is fairly centered around stable abi APIs and reduces the information about the non-abi-stable APIs. Why not have two versions of this tutorial, or, for each code snippet, have one code snippet that is abi-stable and one that is non-abi-stable (this works better if we support collapsible sections, which I'm not sure about)? Then we can have a note at the top to tell the user about the tradeoffs and what they should pick.
eb56d92 to
3415cb8
Compare
Description
Migrate
advanced_source/cpp_custom_ops.rstto libtorch stable ABI/API. Accompanying change toextension-cppChecklist
cc @zou3519