Skip to content

Commit 248ece6

Browse files
authored
enable_python_dispatcher() in propagate_types (#191)
1 parent d8d0372 commit 248ece6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

helion/_compiler/type_propagation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import sympy
1919
import torch
20+
from torch._dispatch.python import enable_python_dispatcher
2021
from torch._dynamo.convert_frame import compile_lock
2122
from torch.fx.experimental import proxy_tensor
2223
from torch.utils._pytree import tree_map_only
@@ -2151,7 +2152,7 @@ def _to_proxy(arg: TypeInfo) -> object:
21512152

21522153
def propagate_types(func: HostFunction, fake_args: list[object]) -> None:
21532154
# Lock needed since patch.object(torch.SymInt.__index__, ...) is not thread safe
2154-
with compile_lock, func:
2155+
with compile_lock, func, enable_python_dispatcher():
21552156
global_scope = GlobalScope(function=func)
21562157
local_scope = LocalScope(parent=global_scope)
21572158
params = inspect.signature(func.fn).bind(*fake_args)

0 commit comments

Comments
 (0)