Skip to content

app::mtp: a pass of several slots' drafts calls the shared draft executor, with no per-body override - #1105

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-cmn-draft-body35
Nov 1, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-cmn-draft-body35

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

여러 slot의 draft 경로가 공용 executor를 바로 부르도록 하고, body마다 둔 차례 실행 기본값과 override를 지웠습니다.

What and why

The draft walks of several slots (SlotWalks::run, slot_chains) now call the shared draft executor (GpuModel::draft_store_slots, GpuModel::draft_chain_slots) directly. MtpBody::store_slots and MtpBody::chain_slots (a one-slot-at-a-time default), the Qwen3.8 and GLM overrides of them, SlotChain, chains_at_once and GLM's refuse_probabilities are removed. The refusal of a probabilities request on a draft whose readback holds ids only now sits in slot_chains, before the round runs, and still names the cause. The multi-slot entry points are bounded by SlotDraft, so a body without it cannot enter them at compile time.

The same shared calls run in the same order with the same launches. Only host Rust changes, no kernel or PTX.

Release notes: internal: the several-slot draft path has one owner, the shared draft executor, instead of a default plus two per-model overrides.

Code shape

The review reads these first. A box left unticked needs one line of why.

  • No second copy. Logic two models (or two call sites) share has one common owner; I lifted it there instead of
    copying it (AGENTS.md "Common code first", docs/rust-quality.md R14). Where I found an existing copy, I
    named it below.
  • Model code holds only architecture facts. A model's own files carry only what its architecture forces
    (tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
  • Dead code is gone. Nothing I made unused is left behind (functions, flags, gate clauses, docs).
  • No silent failure. Undefined input is a named error or panic, never a defined-looking output.
  • Comments state what is true now. No dates, issue numbers or how a bug was found (tools/check-comments.sh).
  • No relaxed gate. No band, tolerance or lint moved to make a check pass; a re-pin carries PIN(YYYY-MM-DD):
    and its reason.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line), or "none": the sequential default in crates/app/src/mtp.rs (MtpBody::store_slots, MtpBody::chain_slots) and its overrides in crates/app/src/arch/qwen3moe/mtp.rs and crates/app/src/arch/glm5next/mtp.rs are removed.

What I ran

Upstream base 1dfd2c2b86d21f1a117cff8bd94d381864d95fed, PR head 663c0f49733f71c6827f03773b6cb729cbb4597f. Fixture tier (BLOOMERY_TIER=fixture) on one GB10:

$ nvidia-smi
Sun Nov  1 21:06:41 2026       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.84                 Driver Version: 595.84         CUDA Version: 13.3     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GB10                    On  |   0000000F:01:00.0 Off |                  N/A |
| N/A   50C    P8              5W /  N/A  | Not Supported          |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

Gates the diff reaches:

$ just gate-gpu-qwen4exp-mtp
(y) two slots in the server's order: 8 drafted passes a slot, a select between every pass; each slot's ids PASS its single-sequence reference's, its proposals and acceptances PASS, its draft store PASS PASS
(z) two slots in one pass at depths 1 and 1 (a pass of 4 rows): 8 passes; each slot's ids, kept rows, draft windows and draft store its window's alone run's; 16 slot passes kept fewer rows than they ran, 0 passes kept different counts on the two slots (printed, not pinned in this tier) PASS
(z) two slots in one pass at depths 3 and 1 (a pass of 6 rows): 8 passes; each slot's ids, kept rows, draft windows and draft store its window's alone run's; 16 slot passes kept fewer rows than they ran, 0 passes kept different counts on the two slots (printed, not pinned in this tier) PASS
(z) waiting: a select of slot 1 while a pass of its verify rows waits for its commit named by the model true, slot 0 still selected at its position true; the commit of one row moved slot 1 one position true PASS
(z) step after: 5 passes of both slots' verify rows at fixed keeps, the last keeping 1 of parked slot 1's 2 rows, then 2 plain steps a slot (slot 0 right after the commit, slot 1 after its select); each slot's ids, each step's id and logits row bit for bit, its lane and position its window's alone run's PASS
(z) plain rounds: 12 passes, a plain slot's waiting rows walked in one store walk of the pass's plain slots; each slot's ids, kept rows, draft windows and draft store its window's alone run's; 3 walks took both slots' rows, 3 passes of slot 1 alone ran beside slot 0's waiting rows, the pass of slot 1's 4 rows alone holds 111 nodes against the body's own 111, 0 walks took more than one row of a slot (printed, not pinned in this tier) PASS
(z) prompt anchor: a plain round after slot 0's GEMM prompt and begin beside slot 1's first step matches immediate walks in ids, commits and draft stores PASS
gpu-gate.sh: gate_qwen4exp_mtp ran 364 s (exit 0)

The (z) lines exercise slot_chains (draft_chain_slots) and SlotWalks::run (draft_store_slots) on Qwen3.8's MTP.

$ just gate-gpu-glm5next-mtp
(z) two slots in one pass: 8 rounds, each window's draft its own and its proposal capped at the seat's depth 1 (a pass of 4 rows), kept slot 0 [1, 1, 1, 1, 1, 1, 1, 1], slot 1 [1, 1, 1, 1, 1, 1, 1, 1]: each window's ids, kept rounds, draft store and position its alone run's; 16 slot rounds kept fewer rows than they ran, 0 rounds kept different counts on the two slots PASS
gpu-gate.sh: gate_glm5next_mtp ran 23 s (exit 0)

The real binary, with MTP on one slot (--arm drafted) and with --parallel 2 (--arm plain, the slots clauses):

$ export BLOOMERY_GATE_V41_LOAD=1 && . tools/ref/ref-paths.sh && A=$(bash tools/arch.sh)
$ cargo oxide build --arch $A -- -p bloomery-gpu-gates --features deepseek41,gemma-embedding2,hf --release --bin bloomery-serve-qwen38 --bin gate_qwen38_serve
$ cargo oxide build --arch $A -- -p bloomery-gpu-gates --features gpu --release --bin generate_qwen3moe
$ bash tools/gpu-gate.sh generate_qwen3moe --place gate --tokens "$REF_TOKENS" -n 16 > $D/gen.log
$ bash tools/gpu-gate.sh gate_qwen38_serve --arm drafted --gen $D/gen.log --prompt "The capital of France is" --ids "$REF_TOKENS" --dir $D/drafted
gpu-gate.sh: gate_qwen38_serve ran 43 s (exit 0)
gate-gpu-qwen38-serve: PASS
37 checks PASS, 0 FAIL
$ bash tools/gpu-gate.sh gate_qwen38_serve --arm plain --gen $D/gen.log --prompt "The capital of France is" --ids "$REF_TOKENS" --dir $D/plain
check slots_parallel_line_names_the_rule: PASS
check slots_parallel_line_names_one_pass: PASS
check slots_rounds_of_both_run_one_pass: PASS
check slots_drafted_off_slot_steps_beside_a_window: PASS
check slots_drafted_late_request_together_alone: PASS
check slots_drafted_late_request_other_order_together_alone: PASS
check slots_drafted_sampled_rounds_run_one_pass: PASS
check slots_drafted_sampled_together_alone: PASS
check slots_drafted_probs_rounds_run_one_pass: PASS
check slots_drafted_probs_together_alone: PASS
check slots_drafted_sampled_tail_drafts: PASS
gate-gpu-qwen38-serve: PASS
gpu-gate.sh: gate_qwen38_serve ran 227 s (exit 0)
59 checks PASS, 0 FAIL

Hardware (if the change is for a machine)

NVIDIA GB10, driver 595.84, CUDA 13.3.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

…utor, with no per-body override

MtpBody::store_slots and MtpBody::chain_slots defaulted to walking the slots
in turn, and both bodies that run several slots (Qwen3.8's Body38 and GLM's
Body) overrode them with the same calls into GpuModel::draft_store_slots and
draft_chain_slots. The two trait methods, their overrides, app's SlotChain and
chains_at_once are gone: SlotWalks::run, pass_slots and its slot_chains call
the shared executor directly on a body that implements SlotDraft, and the
serve seats' generic round paths carry the same bound. The refusal of
probabilities asked of a draft whose readback holds none moves from GLM's
override into slot_chains, read from MtpBody::PROBS, still before the round.

A body that holds one resident sequence (Qwen3.6's Body35, whose MTP load
refuses a second sequence) takes no part in a pass of several slots, now by
its type as well as by that refusal.
@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card labels Nov 1, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: No must-fix defect was confirmed in the shared-executor refactor.

Non-blocking

⚠ Supply verification for the reviewed revision: crates/app/src/mtp.rs:1138. The supplied GPU runs name 1dfd2c2/663c0f4; the reviewed base/head are c297d066/0f83003d. The body omits model-file identity and the PTX equivalence proof required by AGENTS.md's move class. Explain how those runs cover the reviewed revision, identify the model file, and attach the base/head PTX comparison, for example just canon-check c297d066.

Checked

  • Duplicates: 0 new functions, types or constants. Both removed model adapters called the existing shared executors. Dryer reported 0 candidate pairs.
  • Complexity: crapper reported no changed function above its thresholds. slot_chains replaces intermediate chain construction with a capability guard and direct dispatch.
  • Silent failure: the batched and GLM single-chain probability refusals return named errors before their executor calls. No silent-default site was added.
  • Tests: no tests or assertions changed; mutation analysis is not applicable. GPU tests were not rerun during validation.
  • Gates: no threshold, pin, test or gate clause changed.
  • Dispatch: the batched path calls the same executor and writes proposals in batch order; mixed heads or walk modes retain the sequential path.
  • Escape catalog: none of C1–C4 matches the diff.

Notes

Dryer did not search crates/gpu-gates; its changed hunks add imports and trait bounds.

Card check: needs-gpu. This pull request changes crates/app/src/arch/glm5next/mtp.rs, crates/app/src/arch/qwen3moe/mtp.rs, crates/app/src/mtp.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)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 2227bd5 into midagedev:main Nov 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant