Lightning-AI / Lightning-AI/lightning-thunder
Support non_blocking in Tensor.to
Open
Nobody has claimed this yet.
bug
operators
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
import torch
import torch.nn as nn
import thunder
from thunder.core.transforms import grad, autocast
from thunder.examine import examine
def foo(x):
return x.to(device='cpu', non_blocking=True)
x = torch.randn(3, device='cpu')
jfoo = thunder.jit(foo)
jfoo(x)
Error:
TypeError: to() got an unexpected keyword argument 'non_blocking'
This will also allow Tensor.cuda to model this argument as it calls to.
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 by running the Python reproduction in the issue and trace how Thunder handles the Tensor.to arguments. Done means to accepts non_blocking=True without the shown TypeError, and Tensor.cuda can model the same argument through to.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100