Lightning-AI / Lightning-AI/lightning-thunder
Handle returning NamedTuples from the JIT
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
NamedTuples have (some) support in the interpreter, but to return them from the JIT, we would need some more things:
- ensure value tracking covers creation (populating the `attribute_wrappers`) - this is in interpreter,
- when seeing NamedTuples being returned, add epilogue code to create the NamedTuple from its contents (which are available),
This is nontrivial as it requires return values to be routed through the epilogue, but I don't think that is grave.
This is probably an intermediate to advanced issue for people fond of the JIT / frontend bits.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the interpreter's NamedTuple handling and how value tracking populates attribute_wrappers, then trace how JIT return values move through the epilogue. Done means NamedTuples can be constructed from their available contents when returned from the JIT, with return values routed through the epilogue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100