mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Revert "Disable SymDispatchMode when torch.compile'ing (#132433)"
This reverts commit 63eb06c051.
Reverted https://github.com/pytorch/pytorch/pull/132433 on behalf of https://github.com/PaliC due to We need to now revert https://github.com/pytorch/pytorch/pull/132216 in OSS and there is a dependency on this pr ([comment](https://github.com/pytorch/pytorch/pull/132433#issuecomment-2274105080))
This commit is contained in:
parent
ca713b8393
commit
07551887b8
|
|
@ -25,7 +25,6 @@ from weakref import ReferenceType
|
|||
|
||||
import torch
|
||||
import torch._logging
|
||||
import torch.fx.experimental._sym_dispatch_mode
|
||||
from torch._C._dynamo.guards import GlobalStateGuard
|
||||
from torch._dynamo.distributed import get_compile_pg
|
||||
from torch._guards import compile_context, CompileContext, CompileId, tracing
|
||||
|
|
@ -1228,9 +1227,7 @@ class CatchErrorsWrapper:
|
|||
frame, cache_entry, self.hooks, frame_state
|
||||
)
|
||||
|
||||
with (
|
||||
compile_lock
|
||||
), _disable_current_modes(), torch.fx.experimental._sym_dispatch_mode.disable_sym_dispatch():
|
||||
with compile_lock, _disable_current_modes():
|
||||
# skip=1: skip this frame
|
||||
return self._torchdynamo_orig_callable(
|
||||
frame, cache_entry, self.hooks, frame_state, skip=1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# mypy: allow-untyped-defs
|
||||
import contextlib
|
||||
from typing import List, Optional, Type
|
||||
|
||||
|
||||
|
|
@ -59,14 +58,3 @@ def handle_sym_dispatch(func, args, kwargs):
|
|||
|
||||
def sym_function_mode():
|
||||
return SYM_FUNCTION_MODE
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def disable_sym_dispatch():
|
||||
global SYM_FUNCTION_MODE
|
||||
old = SYM_FUNCTION_MODE
|
||||
SYM_FUNCTION_MODE = None
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
SYM_FUNCTION_MODE = old
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user