Skip to content
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

How to use a PJRT plugin from Pytorch? #7855

Open
wwtghx opened this issue Dec 18, 2023 · 6 comments
Open

How to use a PJRT plugin from Pytorch? #7855

wwtghx opened this issue Dec 18, 2023 · 6 comments
Labels
question Further information is requested

Comments

@wwtghx
Copy link

wwtghx commented Dec 18, 2023

In the file https://github.com/openxla/xla/blob/main/xla/pjrt/c/docs/pjrt_integration_guide.md, "How to use a PJRT plugin from JAX" is found, but I want to know "How to use a PJRT plugin from Pytorch"?

@cheshire
Copy link
Contributor

I think the expected usage pattern is via https://github.com/pytorch/xla, which itself should use the PJRT API.

@cheshire
Copy link
Contributor

@JackCaoG for further comments

@JackCaoG
Copy link

Depending on what you mean by use. If you are a user who wants to use PyTorch/XLA with PJRT, it is already the default runtime after 2.1 release. Check out our doc at https://github.com/pytorch/xla/blob/master/docs/pjrt.md#pjrt-runtime.

If you are a backend vender who want to integrate PyTorch/XLA with your backend. @will-cromar recently started the effort of developing the python PJRT plugin for PyTorch/XLA. My understanding is that registration process will be different, but you would also need to implement the PJRT CAPI similar to https://github.com/openxla/xla/blob/main/xla/pjrt/c/docs/pjrt_integration_guide.md#step-1-implement-pjrt-c-api-interface .

@wwtghx
Copy link
Author

wwtghx commented Dec 19, 2023

Yes, I am a backend vender, and I want to integrate PyTorch/XLA with my backend.

@JackCaoG
Copy link

Great, we have helped a couple backend vender to integrated into pytorch/xla. @will-cromar recently started the python plugin effort in pytorch/xla#5644, I expect it to be more mature in a couple months. In the mean time I think you can start with implement the PJRT CAPIs, after that we can help with the backend registration logic.

@will-cromar
Copy link
Contributor

Hey, @wwtghx. It's possible today to use a PJRT Plugin from PyTorch/XLA, but the process is rough around the edges. It basically amounts to updating lists and special cases throughout this repository as in pytorch/xla#5428.

This is an active area of work, and the end goal is to simplify the process and implement a registration mechanism for external plugins like JAX has. I started pytorch/xla#6242 to collect my ideas and track progress. Please take a look and let me know if you have any feedback on the design.

@penpornk penpornk added the question Further information is requested label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants