Why do we have two separated posts "Custom C++ and CUDA Operators" and "Custom C++ and CUDA Extensions"

Hi, I found two different articles in the PyTorch documentation: Custom C++ and CUDA Operators and Custom C++ and CUDA Extensions. After reading through them, I noticed that (if I understand correctly) Custom C++ and CUDA Extensions already covers the content of Custom C++ and CUDA Operators while also providing a much simpler syntax.

However, I don’t quite understand why these two articles are separated. Is there any other purpose that I might have missed while reading?

The extensions tutorial was written in 2018 describing how to add any custom extension to PyTorch and how to call it (in Eager mode). The operator tutorial was written in 2024 and describes how to let torch.compile work with your newly added operator and is also part of the torch.library docs.
I agree both articles are quite similar and I would guess might be cleaned up to make clear when to use which approach.

1 Like