Skip to content

Conversation

qihqi
Copy link

@qihqi qihqi commented Oct 18, 2025

Copy link

meta-cla bot commented Oct 18, 2025

Hi @qihqi!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@qihqi qihqi changed the title Add RFC on python backend RFC-0046-python-backend-registration-api.md Oct 18, 2025
Copy link

meta-cla bot commented Oct 18, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the cla signed label Oct 18, 2025
* Is the API look-and-feel OK? Any improvement on those?

The questions to community is:
* Do you see yourself using something like this, if yes what are the usecases?

Choose a reason for hiding this comment

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

While I cannot comment about the technical aspect of this proposal as I don't know much about pytorch's internals, I can say that I'm really interested in making a custom device + a torch.compile backend in pure python. I'm working with Modular's folks on a Mojo backend for Pytorch here.

I currently rely on pytorch nightly and here is how I setup the device

from torch.utils.backend_registration import _setup_privateuseone_for_python_backend
_setup_privateuseone_for_python_backend("max_device")

# Register all collected aten operations
for op_name, func in _aten_ops_registry:
    torch.library.impl(op_name, "privateuseone")(func)

While it works well, it doesn't integrate well with torch.compile yet. But I must say, the UX is really good. Having to implement just a list of torch.library.impl is quite easy and the error messages are often really clear. I look forward to a better integration with torch.compile() ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants