Repository navigation
runtime, gpu, app, glm5next: bound slot passes by rows and sequence bindings - #744
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No reachable behavior defect or proven quality defect was found.
Non-blocking
⚠ Validate the final planner: crates/runtime/src/lib.rs:130. The body says the GPU runs preceded the final planner move. Re-run stagger, hostless and plain-slots on this head. Attach the tested commit hashes, model path, commands and output so the evidence covers the implementation being merged.
⚠ Supply dispatch proof: crates/runtime/src/lib.rs:130. A packing call adds at most N−1 sequence comparisons for N entries, N ≥ 1 [derived]; the width selector calls the packer for candidate widths. Supply an identical PTX scan for the host move and the same-lease A/B required by AGENTS.md for previously valid rounds.
Optimization headroom
- E. Less work: crates/app/src/lib.rs:721. Reuse row offsets across passes. With 32 plain GLM slots and two slots per pass, repeated prefixes read 240 lengths per round; one traversal reads 32 (1,920 → 256 logical bytes of 64-bit lengths [derived]).
Checked
Shared owner: plain rounds, drafted rounds and width selection call runtime::round_passes.
Complexity: hostless adds a refusal-check clause; serve run adds arm dispatch.
Silent failure: 1 zero-result site followed through both production callers. slots_a_pass documents zero capacity; callers select the fallback or return a named refusal. No new discarded errors.
Tests: static mutation checks reject a dropped sequence condition, missing GLM override, changed slot-0 order, wrong cost packing, missing boundary refusal, and incorrect pass/output routing. The body reports FAIL-first for packing and cost selection.
Gates: no band or tolerance moved. Removed app assertions move to the runtime test with a dated PIN; the widened serve clause has a dated PIN.
Adversarial checks: invalid bounds, maximum row counts, reordered passes and logits offsets are guarded; sibling SlotRows implementations have no proven sequence-limit mismatch.
Escape catalog: C1–C4 do not match.
Notes
No builds or gates were executed during this static review or validation.
Card check: needs-gpu. This pull request changes crates/app/src/lib.rs, crates/app/src/mtp.rs, crates/gpu-gates/src/bin/gate_glm5next_e2e.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
GLM 서버에서 plain 슬롯이 셋이나 넷 동시에 돌면 서버가 중단되던 결함을 고쳐, 한 pass가 묶을 수 있는 sequence 수까지 지켜 여러 pass로 나눠 실행하도록 합니다.
Part of #565. Tracked in #699.
What and why
With three or four plain GLM slots decoding at once, the server could stop. Slot passes were limited by row count only, and the GLM NextN body binds just two sequences per pass. A round of four rows from four slots passed the row check, then failed at the body with
GLM's pass binds two sequences: 0..4.The mismatch came in with
e2d2e22a1c.f20a0dbaccmadeSlotRowsown the row limit and22a8050903routed plain GLM server rounds through that shared pass path, both when the row limit was two.e2d2e22a1craisedLOAD_ROWSfrom two to four for a NextN load, and the sequence binding stayed at two. The same mismatch is on current main.The fix gives the pass limits one owner and splits a round by both limits:
SlotRows::MAX_SLOTSdeclares how many sequences a pass can bind, apart from the row count. It defaults toMAX_ROWS. GLM reads it from its existingRowBind::SEQS.runtime::round_passesowns both limits: it refuses a bound of no sequence or of more sequences than rows, never splits a window, and keeps slot 0's pass last. Plain rounds, drafted rounds and the width cost selector all cut through it.GpuModelchecks the sequence count at the shared boundary for capture, step and verify, before the body runs. The row sum is range-checked before it is added, so it cannot overflow. A call over the limit gets a named refusal there instead of a body error.slots_a_passgives the server's GLM admission check and the shared drafted-window boundary the same two limits. GLM gets nomin(2)and no smaller slot cap.No kernel, launch formula, float arithmetic, gate band or pin changed, and the fix adds no
unsafe. The fix makes a round that used to fail run as two passes, so it makes no speed claim. A round that already fits one pass pays one more host comparison (the sequence count) per pass cut, and its device work is unchanged.Release notes: Fixed: three or four concurrent plain GLM slots now run as several passes instead of stopping the server.
Code shape
round_passes, and the server's admission check reads the same row and sequence data.RowBind::SEQS, and the shared owner carries the new limit.MAX_SLOTSandslots_a_passhave production callers in this diff.PIN.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.cargo fmt --allandgit diff --checkare clean. Clippy was not run.Duplication found or removed (
path:line), or "none": none. ADUPscan flaggedH_SLOTSincrates/gpu-gates/src/bin/gate_glm5next_e2e.rsagainst a constant incrates/gpu/src/card_slots.rs. They count different things (resident sequences in a test, expert contributions per token in a kernel), so they stay apart.What I ran
Hardware for the GPU runs: a GB10 machine in the project's CUDA 13.3 container. The model is the existing GLM fixture, so nothing was downloaded.
nvidia-smibefore the serve gate:runtime::round_passes,cargo test -p bloomery-runtime --lib -- round_packing batch_costs_keep_different_packings_separateexited 101:round_packing_keeps_windows_and_the_slot_zero_pass_lastfailed with3 of 1 at (4, 2),left: 1,right: 2, and the width cost test failed withleft: 0,right: 1.batch_costs_keep_different_packings_separatefails on its own.cargo test -p bloomery-runtime --lib: 289 passed, 0 failed;cargo test -p bloomery-app --lib: 27 passed, 0 failed.BLOOMERY_BOX_LOCAL=1 just gate-gpu-glm5next-staggerended withgpu-gate.sh: gate_glm5next_e2e ran 28 s (exit 0)andclauses: 6 ran, 0 left to the real tier. The new clause (h5) prints(h5) Eager four windows passes=2 solo_ids=true PASSand the same line for Graph: four NextN windows run as two passes in both modes, and their ids match the independent runs.BLOOMERY_BOX_LOCAL=1 bash tools/box.sh 'bash tools/gpu-gate.sh gate_glm5next_e2e --only hostless'exited 0, printinghostless: three sequences refused before capture, step and verify PASSamong its PASS lines for NVFP4 eager=graph=batch, the forced row and the Q4_K trace.cargo oxide build --arch sm_121 -- -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,gemma-embedding2,hf,checkpoint --release --bin bloomery-serve --bin gate_glm5next_serve, thenBLOOMERY_BOX_LOCAL=1 bash tools/box.sh 'bash tools/gpu-gate.sh gate_glm5next_serve --arm plain-slots --dir target/glmrows-serve', exited 0 withgate-gpu-glm5next-serve: PASS. Four concurrent requests each generated 64 token ids (together [Some(64), Some(64), Some(64), Some(64)]), and each matched its independent run. Of the 63 round records, the first ones readrows=3 passes=2 slots=4androws=4 passes=2 slots=4. The capacity and four-request overlap checks print PASS.The unit tests above ran on this head. The three gates above ran before the limits moved into
runtime::round_passes. After the merge I ran all three again on main atf4121587f, on the same GB10 machine in the fixture tier:Mutants that turn each new test red: dropping the sequence condition in
runtime::round_passesfailsround_packing_keeps_windows_and_the_slot_zero_pass_lastandbatch_costs_keep_different_packings_separate; removing GLM'sMAX_SLOTSoverride failspass_limits_match_the_walks_sequence_bindings; running slot 0's pass first fails the slot 0 draft-row check.Not run:
t0, clippy, the full workspace check, and a timing comparison. The change is host scheduling and a shared boundary check, with no kernel change, so it does not touch TP rank slicing or collectives. I ran no two-node check.What I ran into
Nothing here blocks this PR. A round that splits into many passes recomputes the rows ahead of each cut in
Session::step_slots_rounds. A prefix offset computed once would remove that work if many concurrent slots turn out to matter.Reproduction
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.