Repository navigation
qwen38: a pass of several slots runs its MTP chains as one walk a depth over every slot's rows - #1029
Conversation
…th over every slot's rows
There was a problem hiding this comment.
Verdict: CLEAN: No must-fix defect was identified in the changed paths.
Non-blocking
⚠ Complete the dispatch evidence: crates/gpu/src/arch/qwen3moe/body38.rs:2653.
In graph mode, batching replaces S graph replays per depth with K individual kernel enqueues, where S is active slots and K is the grouped walk's launch count [derived]. Grouping also changes launch geometry.
Provide the launch-count delta, PTX equality for the split, and reproducible gate/A/B commands with output for this head, including the nvidia-smi line. The reported runs name earlier heads and omit the timing commands.
Optimization headroom
- G. Per-launch and per-sync fixed cost: crates/gpu/src/arch/qwen3moe/mtp38.rs:2188 and mtp38.rs:2205. Use an
MTP_ROWS-bounded stack buffer forchain_in's rows and iteratechain_rowsdirectly inchain_out. This removes at least two host heap allocations per executed draft depth [derived].
Checked
Duplicates: dryer reported zero pairs; no duplicate finding retained.
Complexity: walk_out 66 and walk_in 28 split existing dispatch; chain_out 21 schedules copies and the fault tail; mtp_chain_slots 17 validates and packs rounds. pass_slots 26→34 adds common batching branches; slots_windows 59→60 adds a harmless depth loop.
Silent failure: three numeric zero-default sites followed; nonempty rounds and active-depth bounds prevent empty walks. Invalid feeds return named errors; device faults poison the call's slots.
Tests: the new unequal-depth clauses retain comparisons of ids, kept rows, draft windows and stores. The PR reports FAIL-first output for the chain_rows mutant at: next → at: b.block; this run was not independently reproduced.
Gates: no thresholds moved or clauses removed; unequal-depth clauses added.
Escape catalog: C1–C4 do not match the diff.
Notes
Builds and GPU gates were not run during this review.
Card check: needs-gpu. This pull request changes crates/app/src/arch/qwen3moe/mtp.rs, crates/app/src/mtp.rs, crates/gpu-gates/src/bin/gate_qwen4exp_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)
|
The review is done and the contribution check passed, so I'm merging this. |
DGX Spark에서 Qwen3.8 MTP 서버가 slot 여러 개의 draft chain을 깊이마다 한 번의 walk로 묶어 돌려 C=4 코드 생성 처리량을 높이는 PR입니다.
What and why
When one forward step covers several slots, each slot's MTP draft chain was its own walk. This PR groups the chains whose refresh reads the step or verify arena and walks them together: depth
jis one walk over the rows of every slot that reaches that depth. Attention still runs per slot against that slot's own store, and one readback serves the whole round. A single chain keeps its own path, so the one-slot case is unchanged. The gate below compares each slot's proposals and draft store with its alone run.crates/app/src/mtp.rs:pass_slotscollects the chain decisions of a window and makes oneMtpBody::chain_slotscall. The default implementation selects the slots one by one and callschain.crates/app/src/arch/qwen3moe/mtp.rs: connectschain_slotstoQwen38Model::mtp_chain_slots.crates/gpu/src/model/slots.rs:GpuModel::on_slotsbinds the named slots' parked sequences.crates/gpu/src/arch/qwen3moe/body38.rs,mtp38.rs:walkis split intowalk_in,attendandwalk_out, and the round uses them with one readback. The single-chain launch list is unchanged.crates/gpu-gates/src/bin/gate_qwen4exp_mtp.rs: two new(z)clauses run two slots at unequal depths, 1 and 3, in both orders.Release notes: Changed: a DGX Spark server running Qwen3.8 with MTP and several slots drafts all slots' chains in one walk, which raises throughput at C=4.
Code shape
The review reads these first. A box left unticked needs one line of why.
Mtp38::chain_end, whichrun_chainandstage_chainboth call.pass_slotsandGpuModel::on_slots, not in a model file.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Base
989d0106b36ca2141adf5d506c3ebdef0c86a1c9, head268d9730f213bd51a8daa8dac4889a5b7f87063d, modelnvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6887e18c089fdea8509a33e63429a3300with its folder MTP draft, served bybloomery-serveon one DGX Spark. Three timed rounds per side, interleaved, P=4096, K=128, temperature 0.7, seed 42, C=2 and C=4.Each side served the model with 4 slots under
bloomery-serve -m <folder>, and a client held C requests in flight. The metric is total tokens per second over the whole request, with the result of the same-window comparison below.Each cell is the median of three rounds. C=4 code-fn is the one resolved gain: base rounds 42.67, 44.02 and 43.37 against head rounds 44.75, 44.29 and 44.93. The other three cells have overlapping ranges.
The changed multi-slot MTP path, on a GB10 at fixture tier, at head
d3f28e0f03ec3b506b773c40f58d8efa9b5bb646:With
at: nextinchain_rowsreplaced byat: b.block, the depths 1 and 3 clause reports a difference:Hardware (if the change is for a machine)
NVIDIA GB10, driver 595.84, CUDA 13.3.1, one DGX Spark, Linux aarch64.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.