You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import thunder
import torch
device = "cuda"
def foo(b):
# TODO: 'device=device' doesn't work for "symbolic values" cache policy
a = torch.arange(24, device=device).reshape(3, 8)
return a + b
jfoo = thunder.jit(foo, cache="symbolic values")
out = jfoo(5)
The script hits
File "/volume/thunder_jit.py", line 9, in foo
a = torch.arange(24, device=device).reshape(3, 8)
^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/core/interpreter.py", line 1302, in wrapping_wrapper
res = ufn(*uargs, **ukwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/core/jit_ext.py", line 374, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/core/symbol.py", line 323, in __call__
result = self.meta(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/core/langctxs.py", line 136, in _fn
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/torch/__init__.py", line 573, in arange
device = maybe_get_default_device(device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/torch/__init__.py", line 130, in maybe_get_default_device
return device or get_default_device()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/lightning-thunder/thunder/core/proxies.py", line 333, in __bool__
raise NotImplementedError(f"__bool__ is not implemented for {type(self)}")
NotImplementedError: __bool__ is not implemented for <class 'thunder.core.proxies.StringProxy'>
inline device="cuda", the issue goes away. It also only errors out with symbolic values cache, which is not surprising since the other cache would hard code the string as a constant.
The text was updated successfully, but these errors were encountered:
🐛 Bug
The script hits
inline device="cuda", the issue goes away. It also only errors out with symbolic values cache, which is not surprising since the other cache would hard code the string as a constant.
The text was updated successfully, but these errors were encountered: