Update Custom C++ and CUDA Operators to use PyTorch stable API/ABI#3701
Update Custom C++ and CUDA Operators to use PyTorch stable API/ABI#3701svekars merged 11 commits intopytorch:mainfrom
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. 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.
remove reference to torch::autograd::Function since we don't support that in stable API/ABI
There was a problem hiding this comment.
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
|
@AlannaBurke is this good to merge? |
AlannaBurke
left a comment
There was a problem hiding this comment.
This looks good, the tabbed content looks really nice!
Description
Migrate
advanced_source/cpp_custom_ops.rstto libtorch stable ABI/API. Accompanying change toextension-cppChecklist
cc @zou3519