Lightning-AI / Lightning-AI/lightning-thunder
Support inplace for slicing views of tensors
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
```py
import torch, thunder
def fn(t):
return t[2].sin_() * 2
jfn = thunder.jit(fn)
jfn(torch.randn(10))
```
gets me
```
NotImplementedError: in-place op of `torch.sin_` to ``, a view tensor of `` is not supported because 1 != 10
```
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 running the provided fn example with thunder.jit and inspect the handling of torch.sin_ on the slicing view t[2]. Trace how the view shape is compared with the base tensor. Done means the example executes without the current NotImplementedError and preserves correct in-place view behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100