Lightning-AI / Lightning-AI/lightning-thunder

Handle jitted functions while jitting

Open
#1,220 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

Maybe first step:
```
def step(m, inp):
return m(inp)

jm = jit(model)
jfn = jit(fn)

jfn(jm, inp)
```

It would be cool if this worked:
```
def step(m, opt, inps):
logits = m(inps)
opt.zero_grad()
m.backward()
opt.step()

jm = jit(model)
jstep = jit(step)

jstep(jm, opt, inps)
```

This is also a crucial part #1134

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nested-jit examples in the issue and read the related issue #1134 for context. No implementation files or tests are named, so first locate the jit entry point and its existing tests. Done should include jitted functions calling jitted functions, including the optimizer-training example shown here.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.