Skip to content

Commit 67bc0bc

Browse files
Kai Lifacebook-github-bot
authored andcommitted
Replace raise by warning to unblock unrecognized torchao version (#3338)
Summary: As title. Differential Revision: D87008228
1 parent e110227 commit 67bc0bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchao/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import warnings
77

88
import torch
9+
from torchao.utils import is_fbcode
910

1011
warnings.filterwarnings(
1112
"ignore", message="Failed to initialize NumPy: No module named 'numpy'"
@@ -48,7 +49,7 @@ def _parse_version(version_string):
4849
force_skip_loading_so_files = (
4950
os.getenv("TORCHAO_FORCE_SKIP_LOADING_SO_FILES", "0") == "1"
5051
)
51-
if force_skip_loading_so_files:
52+
if force_skip_loading_so_files or is_fbcode():
5253
# user override
5354
# users can set env var TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1 to skip loading .so files
5455
# this way, if they are using an incompatbile torch version, they can still use the API by setting the env var

0 commit comments

Comments
 (0)