torch.index_add is broken
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 1.5k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
in both O1 and O2 opt levels, torch.index_add is broken.
RuntimeError: Expected object of scalar type Float but got scalar type Half for argument #4 'source' in call to _th_index_add_
in O1, the error can be fixed by adding index_add to FP32_FUNCS in amp/lists/torch_overrides.py.
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 amp/lists/torch_overrides.py, where the issue identifies FP32_FUNCS and the O1 workaround. Reproduce torch.index_add at both O1 and O2 and inspect how each optimization level handles the operation. Done means the reported scalar-type error no longer occurs at either level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100