Skip to content

Conversation

@jgong5
Copy link
Collaborator

@jgong5 jgong5 commented Oct 21, 2025

Stack from ghstack (oldest at bottom):

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
  2. The interoperability Standard of Third-party Backend Integration Mechanism
  3. PyTorch Backend Accelerator Integration Verification and Guidance

@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.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 21, 2025

🔗 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 (image):

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.

jgong5 added a commit that referenced this pull request Oct 21, 2025
… FFFrog as the maintainer

ghstack-source-id: 9c76d43
Pull-Request: #165958
@jgong5 jgong5 requested a review from albanD October 21, 2025 04:13
@fffrog
Copy link
Collaborator

fffrog commented Oct 21, 2025

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Oct 21, 2025
@fffrog
Copy link
Collaborator

fffrog commented Oct 21, 2025

@albanD @jgong5 Thank you a lot for your recognition and proposal.

Copy link
Collaborator

@albanD albanD left a 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.

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fffrog
Copy link
Collaborator

fffrog commented Oct 23, 2025

Thank you all very much :D @albanD @malfet @ezyang @jgong5

@ezyang
Copy link
Contributor

ezyang commented Oct 27, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 27, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@jgong5
Copy link
Collaborator Author

jgong5 commented Oct 28, 2025

Thank you all very much :D @albanD @malfet @ezyang @jgong5

Echo @fffrog Thank you @albanD @malfet @ezyang for the approval.

tianrengao pushed a commit that referenced this pull request Oct 30, 2025
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants