Studio: startup loading banner and mute the benign bitsandbytes ROCm warning - #7085
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request mutes the benign warning from the bitsandbytes.cextension logger when BNB_ROCM_VERSION is set in both worker.py and main.py. Additionally, it adds flushed console output in run.py to notify users when heavy ML libraries are loading and when the server is starting. 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.
danielhanchen
force-pushed
the
studio-startup-banner-bnb-warning
branch
from
July 12, 2026 10:29
93a51e4 to
5672ddc
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small Studio startup UX fixes for Windows AMD ROCm hosts (and everyone else).
1. Loading banner on startup
run_serverlogsrun_server startup beginand then blocks for up to ~2 minutes onfrom main import app, which transitively imports torch, unsloth, transformers and the bitsandbytes DLL. Nothing prints during that window, so the console looks frozen and people assume the launch hung.This prints a flushed heads-up before the import, plus short progress lines around it:
flush=Trueis required because a redirected or piped stdout is block buffered and we never leave the import to flush it. All output stays gated on the existingsilentflag, and the single insertion inrun_servercovers every entry path (CLI, directrun.py, the Windows re-exec child, Colab).2. Mute the benign bitsandbytes ROCm override notice
On Windows ROCm,
BNB_ROCM_VERSIONis set (by the installer sitecustomize seed, or by the redetection inmain.py/worker.py), which makes bitsandbytes log this on every import:The value is correct (it is the only ROCm DLL the wheel ships, and it matches bitsandbytes' own same-major fallback), so the message is pure noise. This attaches a message-scoped
logging.Filterto thebitsandbytes.cextensionlogger that drops only records containing "environment variable detected", before bitsandbytes imports, in both the server (main.py) and the training worker (worker.py). Real load failures and the actionable "No prebuilt binary for ROCm x.y, loading z instead" mismatch warning are preserved, and the override itself is unchanged.Verification
Booted the server from this branch: the loading banner appears immediately before the slow import, and no bitsandbytes override notice appears in the log even though
BNB_ROCM_VERSION=72is set and unsloth loads. A direct check confirms the filter drops the benign record and keeps the mismatch warning.ruff check,py_compileandast.parsepass on all changed files.Host: Windows 11, Strix Halo (gfx1151), torch 2.11.0+rocm7.13.0.