Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Silence torchao _C*.so load-failure WARNING on torch >= 2.11 (#6712)

Daniel Han101de1927a60
diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py
index 5afd6f4b37a..bff55b4e7b4 100644
--- a/unsloth/import_fixes.py
+++ b/unsloth/import_fixes.py
@@ -158,6 +158,11 @@ if not UNSLOTH_ENABLE_LOGGING:
logging.getLogger("torchao").addFilter(
HideLoggingMessage("Skipping import of cpp extensions due to incompatible torch version")
)
+ # torch >= 2.11 path: torchao dlopens each prebuilt _C*.so and logs "Failed to load
+ # .../_C*.so" when one can't (ABI tag mismatch in the wheel, e.g. a cp310 .so under a
+ # cp312 runtime on Colab, or an arch-specific kernel the GPU lacks). It falls back to
+ # non-cpp paths and Unsloth doesn't use these kernels, so drop the cosmetic record.
+ logging.getLogger("torchao").addFilter(HideLoggingMessage("Failed to load "))
# SyntaxWarning: invalid escape sequence '\.'
warnings.filterwarnings("ignore", message = "invalid escape sequence", category = SyntaxWarning)
# PYTORCH_CUDA_ALLOC_CONF is deprecated warning from torch