From e9891421cb09d2df75e9e4641cea9201f039acad Mon Sep 17 00:00:00 2001 From: Kai Li Date: Mon, 17 Nov 2025 10:40:35 -0800 Subject: [PATCH] Replace raise by warning to unblock unrecognized torchao version (#3338) Summary: As title. Differential Revision: D87008228 --- torchao/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchao/__init__.py b/torchao/__init__.py index b0baf6ff4a..c73ab3e7d5 100644 --- a/torchao/__init__.py +++ b/torchao/__init__.py @@ -6,6 +6,7 @@ import warnings import torch +from torchao.utils import is_fbcode warnings.filterwarnings( "ignore", message="Failed to initialize NumPy: No module named 'numpy'" @@ -48,7 +49,7 @@ def _parse_version(version_string): force_skip_loading_so_files = ( os.getenv("TORCHAO_FORCE_SKIP_LOADING_SO_FILES", "0") == "1" ) -if force_skip_loading_so_files: +if force_skip_loading_so_files or is_fbcode(): # user override # users can set env var TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1 to skip loading .so files # this way, if they are using an incompatbile torch version, they can still use the API by setting the env var