Repository navigation
Studio: keep MiniMax-H3's streamed top-level group on the card between denoise steps - #15796
Merged
Merged
Conversation
H3's modular pipeline has no step callback, so the cross-forward carry never armed and every forward of a fully streamed denoiser (12 GB cards) waited on its 0.8 GB top-level group and its first block. Drive the carry from the scheduler.step wrapper H3 already uses for progress, and drop anything carried at decode entry. UNSLOTH_H3_STREAM_CARRY=0 turns it off.
…n denoise steps The top-level group runs for the whole forward, so a carry issued at its offload still waited for the forward to finish: every 12 GB step paid its 0.8 GB upload (65 ms on an A100). The H3 prefetcher now keeps that group into the next forward, which starts with it anyway, and drops it with the rest of the carry.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
This was referenced Oct 28, 2026
danielhanchen
added a commit
that referenced
this pull request
Oct 28, 2026
## Summary UI jobs fail on unrelated PRs when a llama.cpp, whisper.cpp or audio.cpp release is published mid-run. The prebuilt the job just installed becomes one behind, and Studio shows its update card in the bottom-right overlay rail, over the controls the scripts click: - **Windows UI lane** (the `Chat UI Tests` staging run for #15796, on current main `56278f5f65`): `FAIL in step "turn 3: 'Reply with exactly: world'"`, `Locator.click` on `button[aria-label="Send message"]` times out because the card's button row (`components/llama-update-banner.tsx`) intercepts the click. - **UI parity null control** (`Merge base vs itself, the null` on #15798 / #15799): one cell times out the same way. `UNSLOTH_DISABLE_UPDATE_CHECK=1` already keeps the card down: with it set, `get_update_status` never reports an update (`utils/update_status.update_checks_disabled`), and `test_studiobench_ci_update_checks_off.py` already requires it, but only for two named workflows (`studiobench-ci.yml`, `studio-ui-smoke.yml`). The Windows and Mac UI smokes, the parity arms, inline images, composer compatibility and the frontend browser jobs never set it. #15805 muted the notifications in studiobench's browser seed; this covers every browser lane at the backend, including the Playwright scripts that seed nothing. ## Change - `UNSLOTH_DISABLE_UPDATE_CHECK: '1'` at job level in every job that installs Playwright's browsers or runs studiobench: `studio-windows-ui-smoke` / `studio-mac-ui-smoke` `ui-smoke`, `studio-ui-smoke` `ui-indicator`, `studiobench-ui-parity` `arms` / `verdict`, `studiobench-ci` `selftests`, `studio-inline-images` `images`, `studio-composer-compatibility` `composer`, `studio-frontend-ci` `build` / `windows`. Jobs without a real Studio backend are unaffected by it. - `tests/studio/test_studiobench_ci_update_checks_off.py` now discovers those jobs across all workflows (installs Playwright browsers, runs studiobench, or boots Studio for Playwright) instead of checking two named files, so a new UI lane cannot ship without the switch. A `KNOWN` set of five lanes fails the guard if discovery stops recognising them. The step-level override check and the backend-name check are unchanged. No update-flow lane is touched: `studio-update-smoke` / `studio-windows-update-smoke` do not drive a browser, and `playwright_update_banner_layout.py` (Mac UI smoke) stubs `/api/llama/update-status` and `/api/studio/update-status` with `context.route`, so it does not depend on the backend's check. ## Testing - The guard: 14 passed with this change; against main's workflows it fails for all 10 uncovered jobs, the Windows UI lane and parity arms included. - All 124 test files that read `.github/workflows`: main and this branch fail the same single test (`test_cached_paths_hold_no_credentials.py::test_model_cache_variables_are_not_treated_as_credential_homes`, pre-existing on this host); 6058 passed on main, 6069 here (the new parametrized cases).
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
On a 12 GB card MiniMax-H3 streams its whole int8 denoiser, including the 0.8 GB top-level group (embeddings,
norm_out,proj_out). That group runs from the first block to the last, so it was offloaded at the end of every forward and uploaded again at the start of the next. The compute stream then waited for the whole copy, about 65 ms per step on an A100, plus another 26 ms for block 0, which could not be prefetched while the top-level group filled the window.H3's modular pipeline has no
callback_on_step_end, so the cross-forward carry (#15108) never armed for it. This PR:scheduler.stepwrapper H3 already uses for progress (_scheduler_step_carry, gated by_h3_carry_by_scheduler), and disarms and drops anything carried at decoder entry as a backstop;keep_firstto the H3 prefetcher. When the group that opens the recorded order also closes the forward, it stays on the card into the next forward, which starts with it anyway. Everything else (window, decode drop, interleave and capture checks) is the existing carry logic.On its own, the carry did nothing for H3. When the top-level group is offloaded, the forward's compute is already finished, so its re-upload still sat on the critical path. That measured 4.868 / 4.871 s/step against 4.868 / 4.869 for base. Keeping the group on the card is what removes the wait.
Kill switch:
UNSLOTH_H3_STREAM_CARRY=0(turns off both the carry and the keep).Profile (main
85744ff385, Colab A100-SXM4-40GB, PCIe gen4 x16, 960x544x124, 20 steps)Measured with CUDA events around each prefetch wait and copy,
torch.cuda.set_sync_debug_mode("warn"), and a torch.profiler trace of one warm forward:empty_cache/ allocator segment frees per warm forwardThere is one forward per step. At 16 GiB, streaming is free once the blocks are pinned: 4.776-4.793 s/step against 4.789 fully resident on the same card. With pinning off (
UNSLOTH_DIFFUSION_GROUP_OFFLOAD_PIN=0, which reproduces the log lines of a host with 0 MiB pinnable), the same cell runs at 4.936 s/step (+3.3%). That matches the +3% the Oct 27 benchmark measured at 16 GB on a host whose pin budget was 0, which #15642 addresses.Results (same VM, interleaved base / head processes, 12 GiB ballast + total cap)
UNSLOTH_H3_STREAM_CARRY=0max_memory_allocatedis 7311 MiB on both: the kept group is what the next forward starts with.Recompiling functionlines (TORCH_LOGS=recompiles) in every arm.video.h3_stream_carry: 34 carried copies read across forwards. The kill-switch arm logs none.Tests
tests/test_h3_stream_carry.py(18 tests). They cover H3's loop shape (20 forwards, 19scheduler.stepcalls), one call per step, too few calls (dropped at decode), cancel, the gate (family, streamed, step callback, env), the kill switch, the top-level group kept and uploaded once per render while blocks still stream, and release on an aborted render. With the scheduler-driven step, the decode drop or the keep reverted, 2, 1 and 1 of them fail.test_diffusion_multigpu.pyIDs fail on both.Not covered