Lightning-AI / Lightning-AI/lightning-thunder

Support PyTorch custom ops when they have meta functions (also autograd)

Open
#1,123 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement operators program-coverage
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

PyTorch allows to register meta functions with custom ops
With that information, we should be able to apply the fallback mechanism that @kiya00 developed for PyTorch operations in thunder.

https://pytorch.org/docs/stable/library.html

There also is support for registering backward rules, which might also be of interest.

cc @apaz-cli

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PyTorch custom operator documentation linked in the issue, then inspect Thunder's existing PyTorch fallback mechanism developed by @kiya00. Define how registered meta functions should enable that fallback and determine whether registered backward rules are in scope. Done means custom ops with meta functions work through the fallback path, with coverage for the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.