Lightning-AI / Lightning-AI/lightning-thunder
"requires_grad" attribute on intermediate TensorProxies is unused and misleading
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
_Originally posted by @IvanYashchuk in https://github.com/Lightning-AI/lightning-thunder/pull/1563#discussion_r1890146557_
`requires_grad` of intermediate TensorProxies is ignored in our automatic differentiation code because we haven't done the work of properly threading this property through all computations.
We should remove the ability to query `.requires_grad` from intermediate TensorProxies completely to avoid similar bugs in the future. This can be achieved by introducing a separate "InputTensorProxy" which has this attribute and removing it from the regular TensorProxy.
cc @borda @mruberry @apaz-cli
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 by tracing TensorProxy usages through the automatic differentiation code and identify where intermediate proxies expose requires_grad. Review the proposed InputTensorProxy separation and its effects on existing proxy consumers; the work is done when only input proxies expose the attribute and intermediate proxies no longer do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers, machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100