Revert "Disable dynamo tracing torchrec.distributed (#97824)"
This reverts commit 9d1d95099b0689e8bbd0be3e4fafbad76d8ca524.
Reverted https://github.com/pytorch/pytorch/pull/97824 on behalf of https://github.com/yanboliang due to need to catch more exception
diff --git a/torch/_dynamo/skipfiles.py b/torch/_dynamo/skipfiles.py
index fe5b970..64e901f 100644
--- a/torch/_dynamo/skipfiles.py
+++ b/torch/_dynamo/skipfiles.py
@@ -160,15 +160,7 @@
if isinstance(import_name, types.ModuleType):
return add(import_name.__name__)
assert isinstance(import_name, str)
- try:
- module_spec = importlib.util.find_spec(import_name)
- except AttributeError as e:
- # handle fbgemm conflict caused by import torchrec.
- if "'fbgemm' object has no attribute" in str(e):
- return
- raise
- except ImportError:
- return
+ module_spec = importlib.util.find_spec(import_name)
if not module_spec:
return
origin = module_spec.origin
@@ -206,7 +198,6 @@
"tensorflow",
"tensorrt",
"torch2trt",
- "torchrec.distributed",
"tqdm",
"tree",
"tvm",