Lightning-AI / Lightning-AI/lightning-thunder
`requires_grad` attribute for cache key
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug
The key making logic for Thunder's cache relies on requires_grad attribute of `TensorProxy` but it shouldn't:
https://github.com/Lightning-AI/lightning-thunder/blob/a8c063676cbecad7c196dcfe4fbeacf85775c9c5/thunder/common.py#L394-L400
Thunder does not propagate requires_grad information throughout the trace and therefore this results in many unnecessary cache misses.
cc @mruberry @lantiga @IvanYashchuk
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
Start in thunder/common.py at lines 394-400, where the cache key uses TensorProxy.requires_grad. Trace the key-making logic and verify how differing requires_grad values affect cache reuse; the work is done when that attribute no longer causes unnecessary cache misses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100