Lightning-AI / Lightning-AI/lightning-thunder
[feature request] Indexing with boolean masks
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
## 🚀 Feature
No indexing with boolean mask, for example:
```python
import torch; import thunder
m = x <= 0.5
def f(x, m):
return x[m]
jf = thunder.jit(f)
jf(x, m)
```
fails with
```
RuntimeError: Advanced indexing currently only supports zero or one-dimensional integer tensors, but found a tensor with dtype bool8 and 1 dimensions
```
cc @apaz-cli
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided Python reproducer with PyTorch and Thunder, then trace the advanced-indexing path that raises the boolean-tensor error. Done means the jitted function accepts x[m] when m is a boolean mask and no longer raises this runtime error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100