-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Closed
Labels
dependency issuemodule: regressionIt used to work, and now it doesn'tIt used to work, and now it doesn'toncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
Consider following trivial sample:
import torch
def foo(x: torch.Tensor) -> torch.Tensor:
return torch.sin(x) + torch.cos(x)
if __name__=="__main__":
x = torch.rand(3, 3, device="cuda")
x_eager = foo(x)
x_pt2 = torch.compile(foo)(x)
print(torch.allclose(x_eager, x_pt2))
Following sample can be executed on vanilla ubuntu:20.04
using 2.0.1, but fails with 2.1 release candidate, due to the spurious dependencies:
% python3 foo.py
...
File "/usr/local/lib/python3.8/dist-packages/torch/_dynamo/variables/base.py", line 96, in __call__
obj = type.__call__(cls, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/_dynamo/variables/constant.py", line 36, in __init__
if isinstance(value, np.number):
torch._dynamo.exc.InternalTorchDynamoError: 'NoneType' object has no attribute 'number'
from user code:
File "foo.py", line 4, in foo
return torch.sin(x) + torch.cos(x)
Please note, that this is a regression, i.e. it used to work in 2.0
### Versions
2.1/nightly
cc @ezyang @msaroufim @wconstab @bdhirsh @anijain2305
Metadata
Metadata
Assignees
Labels
dependency issuemodule: regressionIt used to work, and now it doesn'tIt used to work, and now it doesn'toncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module