Skip to content

gpu, gpu-gates, runtime: Qwen3.5/3.6 runs its GDN prompt, verify and closing call on the shared delta store - #1127

Merged
juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:dgx-spark-q38-cmn-q35-callers
Nov 2, 2026
Merged

juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:dgx-spark-q38-cmn-q35-callers

Conversation

@juliankang4

@juliankang4 juliankang4 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Qwen3.5/3.6의 GDN prompt, verify, 닫는 호출을 Qwen3.8이 쓰는 공용 delta store와 공용 epilogue로 옮겨 Qwen3.6 prefill을 약 28에서 30 % 빠르게 하고 중복 코드를 지운 작업입니다.

What and why

On one RTX 5090, Qwen3.6-35B-A3B, 4,096-id prompts, 128 greedy tokens, one request at a time, base against head (medians of three rounds, each round eight windows):

  • Prefill, Q4_K_M, draft off: 14,441.9 to 18,712.5 tok/s (+29.6 %), time to first token p95 286.4 to 221.7 ms (-22.6 %)
  • Prefill, UD-Q4_K_M with its MTP draft: 8,759.1 to 11,213.5 tok/s (+28.0 %) on code and 8,775.3 to 11,244.1 tok/s (+28.1 %) on English prose, time to first token p95 -21.8 %
  • Decode: 351.7 to 351.1 tok/s (-0.15 %) draft off, 286.3 to 285.6 tok/s (-0.24 %) MTP on code, 254.4 to 258.4 tok/s (+1.6 %) MTP on prose. The two drops are under the run's 0.5 % resolution.

The table under "What I ran" has the rounds' ranges. The greedy ids are not equal to base's after a few dozen tokens (first difference at token 42 of the first q36 code request): the chunked prompt computes the delta state in another order than the step path, so the decode continues from a different, equally valid state. Gate clause (h) below shows it for a 160-id prompt.

Qwen3.5/3.6 (Body35) ran its own GDN code for the prompt, the verify of drafted rows and the closing call. This PR moves it onto the owners Qwen3.8 already runs:

  • One delta store for every body (recur.rs RecStore::gdn, linear/seqs.rs GdnRun, enqueue_gdn, recovery_table): one stamped lane, the chunked rule's carry and, on a verifying load only, a verify record. Body35 takes the chunked 16-row prompt past GEMV_COLS rows and commits a verify by replaying every delta layer's kept rows in one launch. Its 8 stamped verify lanes are gone, and Qwen3.8 moved from RecStore::carried onto the same owner.
  • The shared norm-gate epilogue takes the gate as a launch word, so a SiLU gate runs on it (gemm/f32tile.rs, gemm/kernels32.rs, gemm/nvfp4mma.rs, linear/norm_gate.rs gate_act, site::resident_gemm_norm_gate). check_sigmoid is removed. Qwen3.5/3.6's wide delta layer calls it (wide.rs delta_gate) and writes the one q8 form ssm_out reads.
  • The gated head-256 prompt of Qwen3.5/3.6 runs the shared pack-of-four flash with query norm and RoPE (wide.rs flash_gates). Qwen3.6-35B's group-of-eight shape keeps its own flash.
  • The closing call folds the last prompt id into the prompt call (runtime::prompt::fold_marks, recur::close_point, body35.rs call_marks); the Qwen3 and Qwen3.8 seats call bind::prefill_closing, and the CLI's --last-step mirrors the server.
  • The Qwen3 seat's lookup draft rounds run through rounds::step_rows_lookup and pass_rows_lookup (serve_seats/qwen3.rs, served.rs), and a drafted round of both slots is one pass. SlotRows::refuse_verify and keep_slot refuse a verify on a plain load.
  • Placement prices the carry, the stamp and the records (model/src/arch/qwen35moe/place.rs, PlanInputs::verifying): a verifying Qwen3.6 load adds 30 x 393,216 B of records.
  • tools/unsafe-ratchet.txt is recounted (gpu 2965 to 2967 blocks, 407 to 409 fns for recovery_table and recovery_of), and tools/defaults-twins.tsv gets the lookup clause's BLOOMERY_DRAFT=lookup.

Release notes: Changed: Qwen3.5 and Qwen3.6 prompts prefill about 28 to 30 % faster on an RTX 5090 (time to first token down about 22 %), and their prompt, verify and closing-call paths now run on the code Qwen3.8 uses.

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; the unsafe-count re-pin carries 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):

  • Body38's mark carry moved to crates/gpu/src/recur.rs:162 (close_point), shared with Body35.
  • Body38's and Body35's delta step, verify and prompt launches share crates/gpu/src/linear/seqs.rs:63 (enqueue_gdn) and :128 (recovery_table); Body35's 8-lane verify and LaneRun are removed.
  • The Qwen3.8 seat's closing call, fallback and row read repeated crates/gpu-gates/src/bind.rs:2747 (prefill_closing); it now calls it.
  • The fold rule is crates/runtime/src/prompt.rs:174 (fold_marks) for any body with mid-unit state copy.
  • The gate's SiLU and sigmoid epilogues share crates/gpu/src/linear/norm_gate.rs:466 (gate_act); the sigmoid-only check_sigmoid is removed.
  • The closing-call witness runner in gate_qwen35moe_verify and gate_qwen4exp_mtp is crates/gpu-gates/src/prefill_gate.rs:199 (closed_run).

What I ran

Upstream base 7364a5f86917ee9f5cb8816b7cab7043bf7d65a0, PR head c86a49190a3bdb6c381ccb56e345bb6fad5bbd14.

Card

RTX 5090 (the Qwen3.6 timing and gates below):

$ nvidia-smi
Mon Nov  2 05:22:37 2026       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: 13.2     |
+-----------------------------------------+------------------------+----------------------+
| 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 GeForce RTX 5090        Off |   00000000:01:00.0 Off |                  N/A |
|  0%   34C    P8             10W /  400W |       2MiB /  32607MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
$ nvidia-smi --query-gpu=name,driver_version --format=csv,noheader
NVIDIA GeForce RTX 5090, 595.99.02

GB10 card (the Qwen3.8 check below):

$ nvidia-smi
Sun Nov  1 18:48:15 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   52C    P8              4W /  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                                                             |
+-----------------------------------------------------------------------------------------+
$ nvidia-smi --query-gpu=name,driver_version --format=csv,noheader
NVIDIA GB10, 595.84

Models

{"repo": "lmstudio-community/Qwen3.6-35B-A3B-GGUF", "revision": "68a34855558af61cbef0324d31f411be8a506b08",
 "file": "Qwen3.6-35B-A3B-Q4_K_M.gguf", "sha256": "4ac6a06bce551257267f49ad2226f8671a22519ccc1a4dde9d5b433d1f2a410d"}
{"repo": "unsloth/Qwen3.6-35B-A3B-MTP-GGUF", "revision": "5bc3e238d916f48a861bac2f8a1990a0e9b7e98d",
 "file": "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf", "sha256": "0b21525e972670ed59e1812e170b27c26355381f0656ecc4e25617ece7dac58b"}

Qwen3.8 nvidia/Qwen3.8-Flash-Next-FP4-Local at revision b9ce18a6887e18c089fdea8509a33e63429a3300, file checksums (SHA-256):

21 tensor files and the config files
b0ad2a8a314ca96618e21e40d50c0af6e181e6060f9cdd1996c7074d19284c1a  README.md
c3cf9e34abf4f9e36c2d72165aa9c132d3e2a725b6c2586aaa3a8af9d7a81041  chat_template.jinja
b50dbc52a0c83b0cd2a44a372c1fb6b5e0e6827d22f2611c97d4d030f92f6b28  config.json
e70c136c1b78ddc1fb0905bac8e733a4dc448d4f852a5dd75143fffc70be550e  generation_config.json
a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d  merges.txt
5fa166bbb1cf25adda455117563efa72a2072272001f459eedece131ffc913e1  model.safetensors.index.json
27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516  preprocessor_config.json
ebf3648c5f4cd1f24e79789e7803498dc4e74cb52515cc515b2d22cf8161953b  tensors/model-00001-of-00021.safetensors
79a643fc5c024089cecd32ca27dc43e671cbec70ff3628b728909b7656ac43ec  tensors/model-00002-of-00021.safetensors
c45f942203db4c7f5a1071700b93b908495cc790271acddfff39091c2b953923  tensors/model-00003-of-00021.safetensors
071ab9cf963ca0f1a6a194b4cec485f5de18ef9804da915b2e6abd0eb0c707af  tensors/model-00004-of-00021.safetensors
f80d17870eb1d36917257494770984953476583c57737f61fdbd341c957b9715  tensors/model-00005-of-00021.safetensors
3e9183d4ebb267fa92429184d5132d302cb1a98fd049149e5d01dccd4ca65795  tensors/model-00006-of-00021.safetensors
aa1ad959c4d62e0bc4600fd0b57cc2939b463e9fb53dc01020e188552b52ce5a  tensors/model-00007-of-00021.safetensors
0b18844027be74b84b240f23bf3a744bc29b35de0bd384f41c40cd85e6339326  tensors/model-00008-of-00021.safetensors
2d0b6c66790c17f8b1fdcf442f541778c8f0a381aca26c11b9d7cfcf7c96f2f0  tensors/model-00009-of-00021.safetensors
3ed9bd73745aebf6dc136f437b67d6b9fc3d38d25ad84300b399164bc87a72b7  tensors/model-00010-of-00021.safetensors
4936ff28c6cc8b66653ddb9cae28bc284569a1a2f7116819a017dc1a0e517ed8  tensors/model-00011-of-00021.safetensors
dd7df5a6ff73e9960412243f744eab9ec35f4be40da5bb158dc4ba8796b33742  tensors/model-00012-of-00021.safetensors
28a455c8ea4ebaa847fb4cbed2bc1de9eff0b501dd3f848a3a3cfc38778e8500  tensors/model-00013-of-00021.safetensors
6941676e685abf9817d9c48a17fdeda20b2b72d16217555252aa4c602b7f98b8  tensors/model-00014-of-00021.safetensors
2a1129b5acfc24a45bf402aa63dcef08b531aedfdaf5233c65fd3d12dc303fdd  tensors/model-00015-of-00021.safetensors
635e97fbad78fa988647d407e2b58e55d551ef94d798c9b6fb5550de25e86429  tensors/model-00016-of-00021.safetensors
bf60d564d89a805b67f8be5f2847a1b1567a70dbc23d19754395c127568474ad  tensors/model-00017-of-00021.safetensors
c5bde22f9364e82eb25973456795592fdcb4b158bc2095898979a2566bf4c562  tensors/model-00018-of-00021.safetensors
da3dc3b4f428f5b9dd53362691043d0242f48d03adca9b7b553bd9f3a1e96350  tensors/model-00019-of-00021.safetensors
4978bb6b8480cfc02d3c8bc84ba86202889f5f10d090bb17c21fee663cea7683  tensors/model-00020-of-00021.safetensors
48203838f2c76921bddbf1cc51d20a23858c128821a21add55fa1778e5e25283  tensors/model-00021-of-00021.safetensors
0997f410c57a1f4e53b09e4be8f4a172d90edd9564368fb0847030937229b9f3  tokenizer.json
b11349aafa7cdc6a320767cf7ceb29ed82f7eda5d65e8e0819e76f0ce947bf27  tokenizer_config.json
7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13  video_preprocessor_config.json
ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003  vocab.json

Gates on the RTX 5090

New SiLU rows of the epilogue case. With the epilogue's SiLU branch disabled (if act == GATE_SILU changed to if act == u32::MAX in crates/gpu/src/gemm/f32tile.rs), every gate=Silu row fails:

$ BLOOMERY_BOX_LOCAL=1 just gate-gpu-gemm --case zgate
zgate form=Bf16 gate=Silu rows=128 K=64 M=1 edge=normal split_bits=false out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true FAIL
zgate form=Bf16 gate=Silu rows=256 K=128 M=9 edge=normal split_bits=false out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true FAIL
zgate form=Mxfp8 gate=Silu rows=128 K=128 M=1 edge=normal split_bits=false out_form_bits=false eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true FAIL
zgate form=Mxfp8 gate=Silu rows=256 K=128 M=9 edge=nan_o split_bits=false out_form_bits=false eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true FAIL

With the real epilogue, the same command:

zgate form=Bf16 gate=Silu rows=128 K=64 M=1 edge=normal split_bits=true out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true PASS
zgate form=Bf16 gate=Silu rows=256 K=128 M=9 edge=normal split_bits=true out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true PASS
zgate form=Mxfp8 gate=Silu rows=128 K=128 M=1 edge=normal split_bits=true out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true PASS
zgate form=Mxfp8 gate=Silu rows=256 K=128 M=9 edge=nan_o split_bits=true out_form_bits=true eager_graph=true scratch_kept=true unit_cut=true scratch_reuse=true fault_ok=true overflow_reached=true PASS
== GATE gate-gpu-gemm --case zgate rc=0

Verify gate, with the new clauses (f) an unread prompt call over a planted fault, (g) a pass beside a waiting verify, and (h) the closing call:

$ BLOOMERY_BOX_LOCAL=1 just gate-gpu-qwen35moe-verify
(f) an unread prompt call over a planted fault: refused "qwen35moe::prefill::run: device fault at the output head site quant_column (non-finite activation); sites raised in the output head (Qwen35moe step order): quant_column", poisoned Some(Fault { layer: 65534, code: 1, sites: 2, arch: Some(Qwen35moe) }), after reset a clean prompt true PASS
(h) 150 ids: the closing call = the one call's argmax and logits true, its steps' bits true (held true); its last id stepped from the end mark = the call less it and its step true; points [64, 128, 149]; folds true (want true) PASS
(h) 160 ids: the closing call = the one call's argmax and logits true, its steps' bits false (held false); its last id stepped from the end mark = the call less it and its step true; points [64, 128, 159]; folds true (want true) PASS
(h) 5 ids: the closing call = the one call's argmax and logits true, its steps' bits true (held true); its last id stepped from the end mark = the call less it and its step true; points [4]; folds false (want false) PASS
(g) a second resident sequence opens on the verifying load PASS
(g) a pass while slot 1's verify waits: qwen35moe slots: slot 1: qwen35moe slots: a call at position 42 while the verify of 2 rows at 40 waits for its commit (GpuModel::rollback keeps 1..=2); then slot 0 steps to Ok(8253) (the plain run's 8253), slot 1 commits both rows and steps to Ok(198) (the plain run's 198) PASS
gate_qwen35moe_verify: PASS
== GATE gate-gpu-qwen35moe-verify rc=0

Linear gate (the shared delta, recovery and norm-gate kernels):

$ BLOOMERY_BOX_LOCAL=1 just gate-gpu-linear
delta prompt m=512 from a zero state: o same=2097152/2097152 max_ulp=0 state same=524288/524288 max_ulp=0 PASS
delta decode step at depth 512: o same=4096/4096 max_ulp=0 state same=524288/524288 max_ulp=0 PASS
recovery lanes=1 lane=0 kept=4/4 graph=true carry=true base_unchanged=true PASS
lanes rows m=4 from lane 2 of 4: o vs 4 one-token calls same=24576/24576 max_ulp=0; row j's state in lane (c + j) mod 4 true, the whole state (a lane no row wrote untouched) true; stamps [43, 44, 41, 42] (want [43, 44, 41, 42]) PASS
== GATE gate-gpu-linear rc=0

Fixture end-to-end gate for Qwen3.6 (Qwen3.6-35B-A3B-Q4_K_M.gguf, the file listed under "Models"; the delta layers' prompt rule, the closing call and the slots, against the pass and step paths), after cargo oxide build --arch sm_120a -- -p bloomery-gpu-gates --features gpu --release --bin gate_qwen35moe_e2e:

$ BLOOMERY_BOX_LOCAL=1 BLOOMERY_TIER=fixture BLOOMERY_MODEL=qwen35moe ./tools/box.sh 'bash tools/gpu-gate.sh gate_qwen35moe_e2e'
gemv arm Pass plan=pass:5: token 32249 vs the fifth step's 32249, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
gemv arm Gemm plan=ubatch:5: token 32249 vs the fifth step's 32249, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
wide layer=0 Delta state_rel=4.917e-6 ring_rel=1.151e-7 against the pass run (band 1e-4) PASS
prompt stores: worst ratio 1.00 at layer 1 (band 2.5) PASS
ubatch 512 plan=ubatch:512x2: token 41059 vs 41059, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
ubatch 1000 plan=ubatch:1000,24: token 41059 vs 41059, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
ubatch 100 plan=ubatch:100x10,24: token 41059 vs 41059, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
ubatch 1024 two calls of 24 and 1000 ids: token 41059 vs 41059, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
wide tail 16 of 1040 ids, uncut and cut at 1024: token 1760 vs 1760, last logits bit-identical=true, every store bit-identical (layers differing []) PASS
gate_qwen35moe_e2e: PASS
clauses: 21 ran, 10 left to the real tier
gpu-gate.sh: gate_qwen35moe_e2e ran 11 s (exit 0)

Serve gate on the Qwen3.6 Q4_K_M file (BLOOMERY_REF_MODEL), including the two-slot lookup draft rounds:

$ BLOOMERY_BOX_LOCAL=1 BLOOMERY_MODEL=qwen3moe ./tools/box.sh 'cargo oxide build --arch $(bash tools/arch.sh) -- -p bloomery-gpu-gates --features glm5next,clef,mimo2,solar2,minimaxm3,flint,vision,gemma-embedding2,hf,checkpoint --release --bin bloomery-serve --bin gate_qwen3_serve && cargo oxide build --arch $(bash tools/arch.sh) -- -p bloomery-gpu-gates --features gpu --release --bin generate_qwen3moe && D=target/qwen3-serve-gate-q36-$$-real && mkdir -p $D && BLOOMERY_GATE_CARD=${BLOOMERY_GATE_CARD:-any} bash tools/gpu-gate.sh gate_qwen3_serve --model "$BLOOMERY_REF_MODEL" --dir $D'
check completion_ids_are_the_cli_ids: PASS
check qwen35_stripped_resend_keeps_the_turns_end: PASS
check qwen35_extension_keeps_every_held_position: PASS
check lookup_slots_together_alone: PASS
lookup rounds: 49 of 49 records a drafted round of both slots in one pass, 0 in more; (cmd, rows, passes) {("pass", 2, 1)}
check lookup_slots_verify_together: PASS
gpu-gate.sh: gate_qwen3_serve ran 104 s (exit 0)
== GATE gate_qwen3_serve rc=0

BLOOMERY_BOX_LOCAL=1 just check exits 0.

Speed on the RTX 5090

Each side built with cargo oxide build --arch "$(bash tools/arch.sh)" -- -p bloomery-gpu-gates --features glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpoint --release --bin bloomery-serve, started fresh each round with --parallel 1 --ctx-size 16896, two warm requests, then eight windows of 4,096-id prompts with 128 greedy tokens (temperature 0), one lead-in round discarded, then three rounds a side in alternating order:

env BLOOMERY_DRAFT=off BLOOMERY_HOST_ROOM=96G ./<base|head>/target/release/bloomery-serve -m "${MODEL_Q36}" --host 127.0.0.1 --port 18731 --parallel 1 --ctx-size 16896
env -u BLOOMERY_MTP_DRAFT BLOOMERY_DRAFT=mtp BLOOMERY_HOST_ROOM=96G BLOOMERY_MTP_WIDTH=cost ./<base|head>/target/release/bloomery-serve -m "${MODEL_Q36M}" --host 127.0.0.1 --port 18731 --parallel 1 --ctx-size 16896

${MODEL_Q36} is the Q4_K_M file and ${MODEL_Q36M} the UD-Q4_K_M file. Each request is a /completion call with a 4,096-id prompt window of the code or English prose corpus, 128 predicted tokens, temperature 0, one at a time. Median of three rounds [lowest to highest round], change is head against base:

metric base head change ranges
q36, code-fn, prefill tok/s 14,441.9 [14,441.7 to 14,443.0] 18,712.5 [18,711.9 to 18,717.1] +29.57 % apart
q36, code-fn, TTFT p95 ms 286.4 [286.3 to 286.6] 221.7 [221.7 to 221.7] -22.59 % apart
q36, code-fn, decode tok/s 351.7 [351.6 to 351.7] 351.1 [351.1 to 351.1] -0.15 % apart
q36mtp, code-fn, prefill tok/s 8,759.1 [8,758.0 to 8,759.8] 11,213.5 [11,210.3 to 11,216.3] +28.02 % apart
q36mtp, code-fn, TTFT p95 ms 470.7 [470.6 to 470.8] 368.2 [367.9 to 368.3] -21.77 % apart
q36mtp, code-fn, decode tok/s 286.3 [286.3 to 286.4] 285.6 [285.6 to 285.7] -0.24 % apart
q36mtp, prose-en, prefill tok/s 8,775.3 [8,774.6 to 8,778.8] 11,244.1 [11,242.3 to 11,246.5] +28.13 % apart
q36mtp, prose-en, TTFT p95 ms 469.6 [469.5 to 469.9] 367.2 [367.2 to 367.4] -21.80 % apart
q36mtp, prose-en, decode tok/s 254.4 [254.4 to 254.4] 258.4 [258.3 to 259.6] +1.58 % apart

Greedy ids equal base's: no (first difference q36 code, request 0, token 42).

Qwen3.8 on the GB10

The diff also moves Qwen3.8's delta store, closing call and epilogue, so its three arms were timed on a GB10 with the same build and server commands as above and -m "${MODEL_FP4L}" (FP4-Local), arms draft off, MTP at --parallel 1, and MTP at --parallel 2 with two concurrent requests at temperature 0.7 with seed 42. Greedy ids equal base's: yes (24 requests, 3,072 tokens, no difference). Median of three rounds [lowest to highest round], change is head against base:

metric base head change ranges
fp4l-off, code-fn, prefill tok/s 2,880.2 [2,859.8 to 2,892.5] 2,882.5 [2,878.4 to 2,898.3] +0.08 % overlap
fp4l-off, code-fn, decode tok/s 31.38 [30.65 to 31.48] 31.68 [30.54 to 31.71] +0.95 % overlap
fp4l-mtp, code-fn, prefill tok/s 2,707.8 [2,704.0 to 2,719.3] 2,713.5 [2,709.2 to 2,718.4] +0.21 % overlap
fp4l-mtp, code-fn, decode tok/s 58.04 [57.36 to 58.82] 57.57 [57.01 to 59.39] -0.81 % overlap
fp4l-mtp, prose-en, prefill tok/s 2,764.2 [2,746.2 to 2,771.7] 2,777.6 [2,774.6 to 2,783.1] +0.48 % apart
fp4l-mtp, prose-en, decode tok/s 40.28 [40.01 to 40.83] 41.17 [40.99 to 41.19] +2.20 % apart
fp4l-mtp-c2s, code-fn, prefill tok/s 2,698.4 [2,692.6 to 2,701.9] 2,713.1 [2,709.7 to 2,714.2] +0.54 % apart
fp4l-mtp-c2s, code-fn, decode tok/s 32.44 [31.03 to 32.85] 31.44 [30.80 to 31.64] -3.10 % overlap
fp4l-mtp-c2s, prose-en, prefill tok/s 2,755.0 [2,753.9 to 2,759.2] 2,763.0 [2,762.5 to 2,777.8] +0.29 % apart
fp4l-mtp-c2s, prose-en, decode tok/s 26.56 [26.24 to 26.57] 25.58 [25.12 to 26.45] -3.69 % overlap

No arm has a loss with ranges apart: every negative row overlaps (the sampled --parallel 2 rows spread the most). The saved kernel-time sums are within 0.6 % with the same launches per kernel for the two single-slot arms.

Hardware (if the change is for a machine)

  • RTX 5090 32 GB: NVIDIA GeForce RTX 5090, 595.99.02, CUDA 13.2. Qwen3.6 gates and timings.
  • GB10: NVIDIA GB10, 595.84, CUDA 13.3. Qwen3.8 timing.
  • Qwen3.6 files and the Qwen3.8 FP4-Local revision are listed under "Models".

AI help

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

@github-actions github-actions Bot added gpu The card engine: crates/gpu*, crates/app host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Nov 2, 2026
@juliankang4
juliankang4 force-pushed the dgx-spark-q38-cmn-q35-callers branch from 45c76a0 to 03561b9 Compare November 2, 2026 05:07

@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: MUST_FIX: the new streamed-response reader silently accepts malformed draft counters.

Must fix

1. Read draft counters through their existing owner

Kind B: gate_qwen3_serve.rs:2048 converts a present string, null or negative draft_n into zero. The value reaches the sum at line 4577 and the drafted > 0 assertion at line 4620. One malformed response and one valid response with proposals can therefore leave the gate green.

serve_client.rs:346 already owns this contract: both counters omitted means no proposal; malformed counters return a named error. Reusing it is a one-line fix that avoids maintaining a second interpretation (R14, no silent failure). Replace line 2048 with:

                        drafted = serve_client::draft_counts(&v).map_err(|e| e.to_string())?.0;

Non-blocking

⚠ Complete the numeric-change evidence: delta.rs:189 selects the chunked prompt rule, changing the reduction order. Attach the error-model comparison and gate-gpu-e2e count-pin output required by AGENTS.md's “float sum order or precision” class. Connect the reported benchmark head c86a491 to reviewed head 03561b9 through patch equivalence or a new run.

Checked

Duplicates: the existing draft-counter parser covers the new reader's fields. Dryer reported zero pairs in app/model/runtime; it excluded gpu and gpu-gates.

Complexity: diagnostics report 28 for lookup_slots_verify_together; its setup, requests and assertions form gate orchestration. No complexity finding is raised.

Silent failure: followed the counter from the SSE reader through the channel to the aggregate assertion. sse_event checks the terminal event and stop type, but does not validate draft counters.

Tests: a malformed counter contributes zero while another response can keep the aggregate positive. The existing parser has tests rejecting malformed counters and accepting their valid omission.

Gates: the PR body reports hardware gate results but omits the numeric diagnostic and count-pin evidence requested above.

Escape catalog: no entry applies to these findings. No ledger lessons are in force.

Notes

CUDA builds and gates were not run during validation. Hardware results were read from the PR body.

Card check: gpu-evidence. This pull request changes crates/app/src/arch/qwen3moe/mod.rs, crates/app/src/lib.rs, crates/gpu-gates/src/bin/gate_gemm.rs … and carries a gate run on the author's card, which counts as verified.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

Filed outside this PR: #1129

let v = sse_event(e).map_err(|e| format!("curl {url}: {e}"))?;
if v.get("tokens").is_some() {
tokens = ids_of(&v["tokens"]).map_err(|e| format!("curl {url}: {e}"))?;
drafted = v["timings"]["draft_n"].as_u64().unwrap_or(0);

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.

Reuse the existing counter parser so malformed present counters return an error before reaching the gate's aggregate.

Suggested change
drafted = v["timings"]["draft_n"].as_u64().unwrap_or(0);
drafted = serve_client::draft_counts(&v).map_err(|e| e.to_string())?.0;

@github-actions github-actions Bot added gpu-evidence Verified on the author's card: the pull request carries the gate run and its output and removed needs-gpu Changes code a card must check, and carries no gate run on a card labels Nov 2, 2026
…rompt, verify and closing call on the shared delta store, its gated norm on the shared product epilogue and its gated head-256 prompt on the shared pack-4 flash
@juliankang4
juliankang4 force-pushed the dgx-spark-q38-cmn-q35-callers branch from 03561b9 to e78705f Compare November 2, 2026 05:37

@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.

Since the last review:

Verdict: CLEAN: the one-line interdiff resolves the previous must-fix and introduces no new defect.

Non-blocking

⚠ Complete the numeric-change evidence: delta.rs:189 selects the chunked prompt rule, changing reduction order. Attach the error-model comparison (σ against exact-forced-32.tsv) and gate-gpu-e2e count-pin output required by AGENTS.md's “float sum order or precision” class. Connect the measured head c86a491 to the reviewed head through patch equivalence or a new run.

Checked

Duplicates: 0 new items; the changed call reuses serve_client::draft_counts. Dryer reported 0 pairs in app/model/runtime and excluded gpu/gpu-gates.

Complexity: the interdiff adds no branches. The functions flagged by crapper are unchanged since the previous review.

Silent failure: 1 changed site followed through the channel and receiver's ??. Malformed counters stop the gate before aggregation. Both counters omitted in a timings object still mean zero proposals, matching the server's writer.

Tests: no tests changed. Existing parser assertions reject malformed counts and accept valid omissions. Mutant: replacing the parser's error with Ok((0, 0)) fails those rejection assertions; this was checked by inspection.

Gates: no pin, threshold or test changes in the interdiff.

Escape catalog: no matching patterns. No ledger lessons are in force.

Notes

This re-review covers the interdiff and the previous findings. CUDA builds and tests were not run; hardware evidence was read from the PR body.

Card check: gpu-evidence. This pull request changes crates/app/src/arch/qwen3moe/mod.rs, crates/app/src/lib.rs, crates/gpu-gates/src/bin/gate_gemm.rs … and carries a gate run on the author's card, which counts as verified.

🔨 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 e7180ea into midagedev:main Nov 2, 2026
7 checks passed
@midagedev

Copy link
Copy Markdown
Owner

After this merge, main (e7180ea) is red on the 3090 fixture tier. Three causes:

  • gate-ops: arch::qwen35moe::place::tests::a_hybrid_trunk_prices_its_attention_planes_in_the_cache_format fails.
  • gate-fixture-budget, gate-gpu-qwen35moe-e2e (all variants), gate-gpu-qwen35moe-leg (all variants), gate-gpu-qwen3moe-twocard: stale recorded fixture budget 3684696064: … holds [127, 127, 127, 126] experts per layer. The plan bytes moved, so the recorded budget needs a re-record.
  • gate-qwen4exp-meta: red as well.

I can re-record the budgets on the box and look at the place test if you like. Say which you prefer.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Thanks for the report. I will take all three in one pull request today: the a_hybrid_trunk_prices_its_attention_planes_in_the_cache_format place test, the stale fixture budgets and gate-qwen4exp-meta. If re-recording the budgets turns out to need the 3090 box, I will say so here before the PR goes up.

(AI 코딩 에이전트가 작성한 코멘트입니다.)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev #1134 fixes the place test and gate-qwen4exp-meta. All three come from one change in this PR: the shared delta store now adds each GDN layer's carry and one lane stamp to the qwen35moe card cache, and the two tests still pinned the old sums.

The fixture budget is not in the repository. It is the bloomery.fixture.card_budget value in the fixture header, recorded before this PR, so it needs a re-record on the box: move the old folder aside and run fixture fetch qwen35moe /models/fixtures/qwen35moe. That reads the headers over HTTP ranges and needs no card. A fixture recorded at the current plan reads 3,685,744,640 B with 128 experts in every layer, and the budget gates pass on it.

(AI 코딩 에이전트가 작성한 코멘트입니다.)

@midagedev

Copy link
Copy Markdown
Owner

Re-recorded the qwen35moe fixture on the box (old folder kept in /models/fixture-variants). On main b17e44a, fixture tier: gate-fixture-budget, gate-ops, gate-qwen4exp-meta, gate-gpu-qwen35moe-leg and gate-gpu-qwen3moe-twocard are green.

One red is left in gate-gpu-qwen35moe-e2e: the new test hw_last_step_keeps_pass_path (generate_qwen3moe.rs) spawns the CLI with the box's fixture env, and the CLI refuses it:

rows=false:
generate_qwen3moe: BLOOMERY_CARD_BUDGET="3685744640" is refused: this binary (generate_qwen3moe) does not act on it; unset it

The fixture tier exports the fixture's budget to every command. The spawned command could drop it (cmd.env_remove("BLOOMERY_CARD_BUDGET")) or take a placement that acts on it. I can push that fix if you like.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Thanks a lot for re-recording the fixture, for narrowing the last red down to hw_last_step_keeps_pass_path, and for the offer to push the fix. All of our nodes are in the middle of an environment and dependency update right now (kernel, driver and packages), so I cannot pick this up right away. Sorry for the wait.

(AI 코딩 에이전트가 작성한 코멘트입니다.)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev The nodes are back, so I took this one: #1136 is merged. The test's unplaced generate_qwen3moe run now drops the placement levers from its environment, the same way the qwen38 node and two-card gates already do, so the fixture tier's BLOOMERY_CARD_BUDGET no longer reaches it. Thanks again for tracking it down and for re-recording the fixture.

(AI 코딩 에이전트가 작성한 코멘트입니다.)

@midagedev

Copy link
Copy Markdown
Owner

Thanks. With #1136 on main (96aeabf), gate-gpu-qwen35moe-e2e (fixture tier) is green on our 3090: rc 0, 157 s.

@midagedev

Copy link
Copy Markdown
Owner

@juliankang4 The 0.3.12 release batch (real tier, RTX 3090, main 2cd109a) has gate-gpu-qwen35moe-e2e red on two clauses. The fixture tier is green, as I wrote above.

prompt step 1024: worst l_out ratio 1.61 at layer 34, logits from ik ubatch 6.992e-2 pass 6.083e-2 ratio 1.15 (band 1.5) FAIL
split: 82 calls' logits within 0.26 of the off run's, relative: worst 2.976e-1 at call 37 FAIL

At 22ab722 (the parent of 1b28971) both pass: ratio 1.28 at layer 35, split worst 1.834e-1. The pass path is bit-identical before and after. Only the ubatch side moved: layer 0's GDN state gap grew from 2.9e-7 to 3.3e-6 (relative), and no layer shows a wiring-sized jump. So it reads as a rounding move in the prompt path's delta step, not a bug.

I can re-pin the two bands (gate_qwen35moe_e2e.rs:511 and :941) to the measured values with a PIN line, so 0.3.12 can tag. Or you may prefer to look at the delta-step rounding first. Which do you want?

@juliankang4

Copy link
Copy Markdown
Collaborator Author

@midagedev Thanks a lot for running the release batch and for narrowing this down so far. Since the pass path is bit-identical and the gap is only on the ubatch side of the delta step, re-pinning the two bands with a PIN line so 0.3.12 can tag sounds right to me, if that works on the maintainer side. In parallel I'll look at the delta-step rounding on the prompt path and send a PR if the shared step can get back to the old margins; that PR would move the pins back too.

(AI 코딩 에이전트가 작성한 코멘트입니다.)

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 gpu-evidence Verified on the author's card: the pull request carries the gate run and its output host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants