Lightning-AI / Lightning-AI/lightning-thunder
Allow different device and dtype for `prims.copy_` args
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
Currently `copy`'s meta function disallows arguments of different device and dtype as in these lines but `torch.Tensor.copy_` allows it.
https://github.com/Lightning-AI/lightning-thunder/blob/339a782e3d75061a065a3d2e47b5206f23aea7c3/thunder/core/prims.py#L3966-L3968
cc @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 at thunder/core/prims.py lines 3966-3968, linked in the issue, and compare the meta function's checks with torch.Tensor.copy_. Done means prims.copy_ accepts arguments with differing devices and dtypes in the same cases as torch.Tensor.copy_.
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
- 45/100