-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Propose Out-of-tree Backend Integration (PrivateUse1) as a module and FFFrog as the maintainer #165958
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165958
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 541f636 with merge base d7d4bb7 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
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.
Sounds great to me. Thanks @fffrog for all your contributions!
Let's wait for other core maintainers to weigh in before merging please.
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.
LGTM
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
… FFFrog as the maintainer (#165958) I'd like to propose a new module `Out-of-tree Backend Integration` via `PrivateUse1` device key. The out-of-tree backend integration via `PrivateUse1` device key has been a recommended mechanism of plug-in third-party accelerator devices into PyTorch. There are already quite a few documents/tutorials on the usage with the primary one as https://docs.pytorch.org/docs/main/accelerator/index.html. We also saw more and more HW vendors to leverage the `PrivateUse1` mechanism to support their accelerators. For example: 1. Ascend NPU 2. Microsoft MAIA 3. MooreThreads MUSA 4. Cambricon MLU The scope of `PrivateUse1` based out-of-tree backend integration is composed of two parts: 1. `PrivateUse1` device as an out-of-tree backend that involves: (a) make `PrivateUse1` a function-complete device as other in-tree devices: i.e., device runtime, autograd, autocast, profiling, distributed, quantization etc. (b) a pluggable design to allow out-of-tree integration to extend the functionality of `PrivateUse1` such as a backend registration mechanism that allows user-friendly device naming, runtime extension points with either C++ and Python for third-party to plug-in their runtime implementation, customizable tensor implementation for third-party to add extra info/functionality to the tensor and their serialization. 2. OpenReg: A test suite and documentation effort to guarantee the functional correctness of `PrivateUse1` mechanism and to guide HW vendors with the right implementation. I'm also proposing @fffrog as the module maintainer for this new module due to his continuous contribution to the design and implementation both parts of the module. Below are the RFCs/Feature Proposals @fffrog was working on: 1. [An improvement of PrivateUse1 mechanism, facilitating third-party backend integration](https://docs.google.com/document/d/1_2EO5A2Ww3xDwqbhIvs9Nk65-jV0oNYg3XAmNUsHdAY/edit?tab=t.0#heading=h.5vt8c1vo4dc7) 2. [The interoperability Standard of Third-party Backend Integration Mechanism](https://github.com/pytorch/rfcs/blob/9bd181e74225af94547c9fefcbeeca1cae907193/RFC-0037-Interoperability-Standard-of-3rd-Backend-Integration-Mechanism.md) 3. [PyTorch Backend Accelerator Integration Verification and Guidance](https://github.com/pytorch/rfcs/blob/f6048cbd4fcc7877de6b049f96c0b9dece74cbd8/RFC-0045-PyTorch-Accelerator-Integration-Enhancements.md) @fffrog contributed 240+ PRs and a majority of them is related to `PrivateUse1`. (https://github.com/pytorch/pytorch/pulls?q=is%3Apr+author%3Afffrog+). He also reviewed 50+ PRs related to this area. He is also the primary author of OpenReg. Pull Request resolved: #165958 Approved by: https://github.com/albanD, https://github.com/malfet, https://github.com/ezyang
Stack from ghstack (oldest at bottom):
I'd like to propose a new module
Out-of-tree Backend IntegrationviaPrivateUse1device key. The out-of-tree backend integration viaPrivateUse1device key has been a recommended mechanism of plug-in third-party accelerator devices into PyTorch. There are already quite a few documents/tutorials on the usage with the primary one as https://docs.pytorch.org/docs/main/accelerator/index.html.We also saw more and more HW vendors to leverage the
PrivateUse1mechanism to support their accelerators. For example:The scope of
PrivateUse1based out-of-tree backend integration is composed of two parts:PrivateUse1device as an out-of-tree backend that involves:(a) make
PrivateUse1a function-complete device as other in-tree devices: i.e., device runtime, autograd, autocast, profiling, distributed, quantization etc.(b) a pluggable design to allow out-of-tree integration to extend the functionality of
PrivateUse1such as a backend registration mechanism that allows user-friendly device naming, runtime extension points with either C++ and Python for third-party to plug-in their runtime implementation, customizable tensor implementation for third-party to add extra info/functionality to the tensor and their serialization.PrivateUse1mechanism and to guide HW vendors with the right implementation.I'm also proposing @fffrog as the module maintainer for this new module due to his continuous contribution to the design and implementation both parts of the module. Below are the RFCs/Feature Proposals @fffrog was working on:
@fffrog contributed 240+ PRs and a majority of them is related to
PrivateUse1. (https://github.com/pytorch/pytorch/pulls?q=is%3Apr+author%3Afffrog+). He also reviewed 50+ PRs related to this area. He is also the primary author of OpenReg.