Repository navigation
Suppress only torchao's cosmetic cpp-extensions warning - #6506
Conversation
torchao logs a cosmetic WARNING on torch < 2.11 from torchao/__init__.py
(logger.warning("Skipping import of cpp extensions due to incompatible
torch version...")). The bnb-4bit and Unsloth paths do not use torchao's
cpp kernels, so the message is noise.
The quiet block raised the whole torchao logger to ERROR, which also hid
any genuine torchao warning, plus a redundant stderr substring filter.
Replace both with a HideLoggingMessage logging filter scoped to the
torchao logger that drops only this one record, leaving every other
torchao log intact.
There was a problem hiding this comment.
Code Review
This pull request refactors how torchao warnings are suppressed in unsloth/import_fixes.py. Instead of setting the entire torchao logger level to ERROR and filtering stderr, it adds a specific HideLoggingMessage filter to the torchao logger to only suppress the cosmetic warning about incompatible torch versions for cpp extensions, preserving other logs. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
On torch < 2.11, importing torchao prints a cosmetic WARNING:
It is emitted from
torchao/__init__.pyvialogging.getLogger("torchao").warning(...). The bnb-4bit and Unsloth paths do not use torchao's cpp kernels, so this is just log noise.The quiet block in
unsloth/import_fixes.pyalready targeted this message, but did so with:setLevel(logging.ERROR)is a blanket suppressor: it also hides any genuine torchao WARNING (for example a real kernel-load failure), and the stderr substring filter is a redundant second channel that would also match the unrelatedTORCHAO_FORCE_SKIP_LOADING_SO_FILESmessage.This swaps both for a single
HideLoggingMessagelogging filter (the same helper already used for theHF_TOKENmessage) scoped to the torchao logger, dropping only this one record while every other torchao log passes through.Verified
logging).