Hi All,
I am new to pytorch and would like to register a new device with pytoch, can some one point me to a good documentation for the same along with some example codes.
Regards
Amit
Hi All,
I am new to pytorch and would like to register a new device with pytoch, can some one point me to a good documentation for the same along with some example codes.
Regards
Amit
Hello,
I found extremely useful the file testing functionality of custom backend. It gives minimal example of new device secretly storing data on CPU RAM, and showcasing most of the things you might need.
Permalink pytorch/test/cpp_extensions/open_registration_extension.cpp at 7fd3b6988681557a4dfc35dc99807cdd78e805c9 · pytorch/pytorch · GitHub
It is compiled dynamically in this file pytorch/test/test_cpp_extensions_open_device_registration.py at 7fd3b6988681557a4dfc35dc99807cdd78e805c9 · pytorch/pytorch · GitHub
however can be also compiled as a static python library in the way explained in this tutorial Extending dispatcher for a new backend in C++ — PyTorch Tutorials 2.4.0+cu121 documentation
Relevant documentation comments on the functionality used there can be found here Facilitating New Backend Integration by PrivateUse1 — PyTorch Tutorials 2.4.0+cu121 documentation
and here Registering a Dispatched Operator in C++ — PyTorch Tutorials 2.4.0+cu121 documentation
Hope it would be helpful for someone!