-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to register installed plugins automatically #6328
Conversation
Marking this a draft for now while I figure out how to register |
|
||
|
||
def register_installed_plugins(): | ||
pjrt_entry_points = importlib_metadata.entry_points(group='torch_xla.plugins') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you have 'torch_xla.plugins': ['tpu = torch_xla._internal.tpu:TpuPlugin',],
in the setup.py. I wonder what this line does under the hood
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entry points are weird. setuptools
' docs have the best explanation that I've read.
Tested manually on TPU to confirm that this works. |
See #6242 for context
XLA_REGISTER_INSTALLED_PLUGINS
to automatically register any plugin with thetorch_xla.plugins
entry point.importlib.metadata
, which are backported inimportlib_metadata
.