pytorch/docs/source/dynamo
Yaoyao Ding 57b22bc6d8 [Dynamo] Backend registration with `entry_points` (#93873)
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:
![image](https://user-images.githubusercontent.com/23381083/216133221-18cf18e2-6ad6-4cf7-8da2-9b9b883389c8.png)
(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
2023-02-14 15:44:25 +00:00
..
custom-backends.rst [Dynamo] Backend registration with `entry_points` (#93873) 2023-02-14 15:44:25 +00:00
deep-dive.rst [dynamo] Write full code of how to enable output_code (#91230) 2022-12-22 14:09:06 +00:00
faq.rst Fix typo under docs directory (#92762) 2023-01-23 18:07:22 +00:00
get-started.rst Tag dynamo backends as debug/experimental (#93878) 2023-02-04 00:50:51 +00:00
guards-overview.rst Fix typo under docs directory (#92762) 2023-01-23 18:07:22 +00:00
index.rst
installation.rst
troubleshooting.rst [BE] [1/3] Rewrite super() calls in caffe2 and benchmarks (#94587) 2023-02-11 18:19:48 +00:00