Skip to content

fix(models): stop model loaders from printing progress to stdout - #2216

Merged
inureyes merged 1 commit into
mainfrom
fix/issue-1794-loader-stdout
Oct 7, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/issue-1794-loader-stdout

Conversation

@inureyes

@inureyes inureyes commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Loader progress from fourteen files under src/models and src/loading went to stdout and corrupted the TSV that examples/logit_trace writes there. It now goes to tracing::info! (message text unchanged), so it shows in the server at the default level and in mlxcel generate only with RUST_LOG. The duplicate Qwen3.5 FP8 requantize line is dropped because requantize_block_fp8_weights already logs it. The MLXCEL_MLA_ABSORBED report and the unused llama4 forward_debug dumps use eprintln!, and the MLA doc comment, docs/environment-variables.md and docs/mla-absorbed-decode.md now say stderr.

tests/model_loader_stdout_guard.rs walks both directories and fails on println!, print! and stdout() outside *tests.rs files and comments, with an empty allow-list that fails on a stale entry. It runs inside make verify and make verify-rocm through the workspace test step.

Verification

On gfx1151 (--features rocm):

  • The issue's grep prints nothing.
  • The guard passes; with println!("x"); planted at src/models/mamba2.rs:698 it fails with src/models/mamba2.rs:698: println!("x");, and passes again after the revert.
  • logit_trace on models/mlx/NVIDIA-Nemotron-3-Nano-30B-A3B-4bit writes a file starting # model; compare_logit_traces.py self-comparison exits 0 with verdict: byte-identical in effect.
  • mlxcel generate on the same model prints 0 [NemotronH] lines by default and 5 on stderr with RUST_LOG=info.
  • cargo clippy -p mlxcel --features rocm --lib --tests -- -D warnings is clean. make verify-versions verify-kernel-dtype-keys verify-kernel-port-dispatch verify-llama-compat verify-fmt pass.
  • make verify-rocm on the branch rebased onto c684cf3: 12129 passed, 1 failed, 394 ignored. The one failure is -p mlxcel-core --lib cache::attend::attend_tests::batched_masked_rows_get_their_own_mask_row (from refactor: move KV attention dispatch into the cache (#2171 Phase 4a) #2210, already on main); this PR changes no mlxcel-core file. Everything else, including the new guard, fmt, clippy and the smoke run, passed.

Not verified: models/mlx/mamba2-130m and deepseek-v2-lite-chat-4bit-mlx are not on this host, so the stderr MLA line is covered by code reading only. Metal and CUDA were not run (not available); this change only swaps print macros and touches no backend code.

Closes #1794

Fourteen files under src/models and src/loading wrote loader progress with println!. examples/logit_trace writes its TSV to stdout, so a trace of any affected family started with non-data lines and scripts/compare_logit_traces.py failed to parse it.

Loader progress now goes through tracing::info! with the message text unchanged, and the duplicate Qwen3.5 FP8 requantize line is dropped because requantize_block_fp8_weights already logs it. The MLXCEL_MLA_ABSORBED fold report and the unused llama4 forward_debug dumps use eprintln!, and the MLA doc comment and docs now say stderr.

tests/model_loader_stdout_guard.rs walks both directories and fails on println!, print! and stdout() outside tests files and comments, with an empty allow-list that fails when an entry goes stale. It runs inside verify and verify-rocm through the workspace test step.

Closes #1794
@inureyes inureyes added status:done Completed type:bug Bug fixes, error corrections, or issue resolutions priority:low Low priority labels Oct 7, 2026
@inureyes
inureyes merged commit a2b17c1 into main Oct 7, 2026
26 checks passed
@inureyes
inureyes deleted the fix/issue-1794-loader-stdout branch October 7, 2026 13:07
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low Low priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(models): stop model loaders from printing progress to stdout

1 participant