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
fix RuntimeError: not allowed to set torch.backends.cudnn flags after disable_global_flags (#3343)
Summary:
# context
* after fix github CI workflow (GPU unit tests) we found lots of errors come from the same root cause:
```
torchrec/test_utils/__init__.py:129: in _wrapper
return wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torchrec/distributed/test_utils/multi_process.py:131: in setUp
torch.backends.cudnn.allow_tf32 = False
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <torch.backends.ContextProp object at 0x7f4e8bb3ba10>
obj = <module 'torch.backends.cudnn' from '/opt/conda/envs/build_binary/lib/python3.11/site-packages/torch/backends/cudnn/__init__.py'>
val = False
def __set__(self, obj, val):
if not flags_frozen():
self.setter(val)
else:
> raise RuntimeError(
f"not allowed to set {obj.__name__} flags "
"after disable_global_flags; please use flags() context manager instead"
)
E RuntimeError: not allowed to set torch.backends.cudnn flags after disable_global_flags; please use flags() context manager instead
```
* according to D77758554, the issue is due to D78326114 introducing `torch.testing._internal.common_utils`
```
# torch/testing/_internal/common_utils.py calls `disable_global_flags()`
# workaround RuntimeError: not allowed to set ... after disable_global_flags
```
Differential Revision: D81529616
0 commit comments