Skip to content

Commit d8c1f02

Browse files
authored
[CPU] Fix issue: No module named 'fbgemm_gpu.experimental' (#3292)
fix fbgemm_gpu import issue
1 parent 9008f84 commit d8c1f02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchao/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,10 @@ def is_package_at_least(package_name: str, min_version: str):
11531153
def _is_fbgemm_gpu_genai_available():
11541154
# TODO: use is_package_at_least("fbgemm_gpu", "1.2.0") when
11551155
# https://github.com/pytorch/FBGEMM/issues/4198 is fixed
1156-
if importlib.util.find_spec("fbgemm_gpu") is None:
1156+
if (
1157+
importlib.util.find_spec("fbgemm_gpu") is None
1158+
or importlib.util.find_spec("fbgemm_gpu.experimental") is None
1159+
):
11571160
return False
11581161

11591162
import fbgemm_gpu.experimental.gen_ai # noqa: F401

0 commit comments

Comments
 (0)