Revert "[Dynamo] Remove ignored modes workaround (#135502) (#137115)"

This reverts commit b1fd7708bd81d8d52908bf4459ed024471abd803.

Reverted https://github.com/pytorch/pytorch/pull/137115 on behalf of https://github.com/huydhn due to The top of the stack has been reverted but it leaves trunk in a broken state, so I try to revert the rest of the stack ([comment](https://github.com/pytorch/pytorch/pull/137114#issuecomment-2400765603))
This commit is contained in:
PyTorch MergeBot
2024-10-08 20:33:17 +00:00
parent e5f9131327
commit 8c937445ee
4 changed files with 88 additions and 5 deletions

View File

@ -69,6 +69,12 @@ banned_attrs = [
if is_tensor_base_attr_getter(fn)
]
# Today set default device is placed in the graph and guarded on separately
# so we should not trace through it. In the future we can trace it once
# mode tracing is implemented and not put in the graph, but this is more
# of a BE project and can be evaluated later
IGNORED_MODES = {DeviceContext}
@functools.lru_cache(None)
def get_prev_stack_var_name():