mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Fixes #91824 This PR add a new dynamo backend registration mechanism through ``entry_points``. The ``entry_points`` of a package is provides a way for the package to reigster a plugin for another one. The docs of the new mechanism:  (the typo '...named "my_backend" that has been..." has been fixed to '...named "my_compiler" that has been...') # Discussion ## About the test I did not add a test for this PR as it is hard either to install a fack package during a test or manually hack the entry points function by replacing it with a fake one. I have tested this PR offline with the hidet compiler and it works fine. Please let me know if you have any good idea to test this PR. ## About the dependency of ``importlib_metadata`` This PR will add a dependency ``importlib_metadata`` for the python < 3.10 because the modern usage of ``importlib`` gets stable at this python version (see the documentation of the importlib package [here](https://docs.python.org/3/library/importlib.html)). For python < 3.10, the package ``importlib_metadata`` implements the feature of ``importlib``. The current PR will hint the user to install this ``importlib_metata`` if their python version < 3.10. ## About the name and docs Please let me know how do you think the name ``torch_dynamo_backend`` as the entry point group name and the documentation of this registration mechanism. Pull Request resolved: https://github.com/pytorch/pytorch/pull/93873 Approved by: https://github.com/malfet, https://github.com/jansel |
||
|---|---|---|
| .. | ||
| custom-backends.rst | ||
| deep-dive.rst | ||
| faq.rst | ||
| get-started.rst | ||
| guards-overview.rst | ||
| index.rst | ||
| installation.rst | ||
| troubleshooting.rst | ||