Skip to content

Commit 8c76460

Browse files
gchalumpfacebook-github-bot
authored andcommitted
PyTorch version compatibility check in _load_library
Summary: The version compatibility check in `_load_library` incorrectly uses exact string equality when comparing PyTorch versions, causing false incompatibility warnings. PyTorch versions typically include build metadata like `"2.8.0+cu118"` or `"2.8.1+cpu"`, while the compatibility table contains base versions like `"2.8"`. Differential Revision: D85167315
1 parent 06285d6 commit 8c76460

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fbgemm_gpu/fbgemm_gpu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _load_library(filename: str, version: str, no_throw: bool = False) -> None:
8080
"""
8181
)
8282

83-
elif str(torch.__version__) != _fbgemm_torch_compat_table[keys[0]]:
83+
elif not str(torch.__version__).startswith(_fbgemm_torch_compat_table[keys[0]]):
8484
logging.warning(
8585
f"""
8686
\033[31m

0 commit comments

Comments
 (0)