The GDN alpha/beta kernel (a few blocks, latency-bound) and the QSA indexer's chain (its key projection and append,
the query projection, norm and rope, the block scores and top-k) only need the mixer's input; they now run on a
branch of the graph beside the projections and join before the recurrence and the attention. Per layer, IQ3_XXS
(--window-profile): GDN mixer 85.6 -> 76.5 us on thinking text, 100.6 -> 85.9 on code; QSA 151.4 -> 132.9 and
163.3 -> 142.9.
Fixed text against the previous commit, 2 alternating rounds: IQ3_XXS code +2.1%, thinking +3.2%; UD-Q4_K_XL code
+1.6%, thinking +0.9%. Same kernels on another stream: window hashes identical (both models, thinking and code;
--spec-split, --pcie-frac 0.3, --second-gpu -1).
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
verify_router takes a layer's router logits (bf16_gemv_fp32_mmvf_multi's block, its arithmetic now shared through
mmvf_multi.cuh), the first blocks also copying the input rows to mapped memory in 16-byte stores; the last block to
finish routes the tokens (native_router_top10's code, route_token), publishes the ids and weights, writes the ring's
number (known at capture: no read of the mapped counter) and plans the main GPU's hits (hit_plan_block, shared with
verify_hit_plan). It replaces four kernels on the main stream and three on the prediction branch. 21.0 -> 16.3 us at
1 token, 31.5 -> 21.7 at 4; verify_parity checks it bitwise against the four.
--window-profile: the router, ring and hit plan are one stage ("router, ring, hits"), followed by the experts'
activations ("expert inputs").
With the up-projection change, fixed text against the previous commit, 2 alternating rounds: IQ3_XXS code +1.6%,
thinking +2.1%; UD-Q4_K_XL thinking +1.6%, code unchanged. Window hashes identical to the build before the
interleaved projections (both models, thinking and code; --spec-split, --pcie-frac 0.3 kernel and direct,
--second-gpu -1).
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
The quantizer also writes the tokens' q8_1 values interleaved (a position of every token in one 16-byte word,
block-major for the K-quants and Q8_0, position-major for IQ4_XS and IQ3_S). A warp then takes 2-4 rows, decodes
each weight block once and applies it to every token with the single-token dot's arithmetic, walking the chunks of
the exact layout's four warps with a sum per warp (IQ3_S: row_dot's one sum) added in the same order before the
xor tree, so every value is bitwise the multi-column kernel's. Matrices of fewer than 2048 rows and single tokens
keep the old kernels. Used for the mixer's projections and the head.
Per call, 4 tokens (mmvq_il_parity --bench): IQ4_XS 2560x10240 40.7 -> 29.3 us, Q6_K 68.7 -> 47.4, Q8_0 60.9 ->
43.1, IQ3_S 2560x6144 48.8 -> 21.3; 2 tokens 10-35% faster. Fixed text, 2 alternating rounds: IQ3_XXS code +3.8%,
thinking +2.1%; UD-Q4_K_XL within noise. Window hashes identical to the previous build (both models, thinking and
code; --spec-split, --pcie-frac 0.3, --second-gpu -1).
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
The average wait hides which side a layer waits on: the histogram shows the layers whose rows were in when the GPU
got there (the flag's poll alone takes 5-8 us). On IQ3_XXS thinking text that is 74% of the layers; on code, and
with UD-Q4_K_XL, the CPU side is the later one in most.
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
The window copies a snapshot of the residency table (Verifier::residency, which the pool reads too) and plans the
main GPU's hits on the device (verify_hit_plan), so its cached experts start right after the doorbell instead of
waiting for the host's plan; the host plan now carries only the PCIe share, and the combine takes both lists. The
shared expert runs on a graph branch of its own, forked at the doorbell and joined before the combine, and no
longer converts the activations to BF16 when the native gate reads them in FP32. Window hashes unchanged on both
models (also with a PCIe share, --spec-split and --second-gpu -1); verify_parity checks the plan against the
host's grouping and the combine with two lists.
Fixed text, both GPUs: IQ3_XXS code 105.4 -> 108.9 t/s, thinking 89.1 -> 93.2; UD-Q4_K_XL code 86.9 -> 88.0,
thinking 74.7 -> 77.5.
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
The hash's per-window cudaMemcpy of the final residual rows queued behind the adaptive tier's expert copies
on the copy engine and slowed generation (UD-Q4_K_XL code 89 -> 77 t/s with the tier on). With
--window-hashes the verify graph now copies them into mapped host memory with a kernel after the head. Same
bytes hashed (identical files to the previous build); UD-Q4_K_XL code with hashes 88.3 t/s.
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
The verify window's staging waited 0.4-0.7 ms a round for the SSD reads of its tokens' PLE rows. The graph
now waits for them (a host flag) before layer 1, the first to read them: the host starts the reads before the
launch and collects them while layer 0 runs. The next window's first token, and each draft likely to be
verified (probability >= --spec-min-p), start their reads as soon as they are known (Verifier::ple_ahead,
MtpDrafter::on_draft), in read-ahead slots of the PLE table beside its single-token issue/collect.
Window hashes unchanged (fixed text, --adapt-every 0, both models). Host time per round 0.41-0.71 ->
0.03-0.19 ms; generation IQ3_XXS code +2.5%, thinking +1.5%; UD-Q4_K_XL code +1.3-1.6%, thinking +1.1%.
Claude-Session: https://claude.ai/code/session_01YDx8gSYSbts2783qXv2Nxz
Each layer's router also runs on the previous layer's FFN input on a side branch of the verify window's graph; once
the CPU's rows of a layer are in, the host copies the next layer's likeliest experts that no GPU holds into prefetch
slots on the second GPU (~0.3 ms of idle RAM per layer), and that layer's share takes them from there. The second
GPU's down kernel wrote its rows one float at a time into mapped host memory: 0.25 ms a layer, and the CPU pool read
RAM at 38 instead of 48 GB/s. UD-Q4_K_XL code, fixed text: 71.6 -> 77.4 t/s (rows) -> 86.1 (prefetch 4); thinking
70.2 -> 73.6.
qsa_block_scores launched a warp for every block of the full context
(max_cells / 4, 50K blocks at 200K) for every query, nearly all of them
idle. Its warps now go round over the blocks: the verify window and the
token path use a fixed grid of 1024 per query, the prompt path the chunk's
largest n_bid + 1. Each score is computed as before (bitwise).
qsa_prefill_attn: the prompt path's attention, a block per (KV head, query)
walking the query's selected cells in tiles of 64 with an online softmax,
instead of the decode kernel's split-K partial sums through memory. FP32;
int8 codes are converted without I2F. verify_parity checks it against the
decode kernel (relative difference 3.9e-6).
16K-token prompt: IQ3_XXS 18.3 -> 15.9 s, UD-Q4_K_XL 24.8 -> 22.4 s.
RoPE (native_rope_apply_tokens), the int8 K/V append (kv_append_q8_steps),
the indexer append (native_qsa_indexer_append_multi), the q/gate split, the
q/k norms and the gate now run once per window instead of once per token.
Each token's arithmetic is unchanged: verify_parity checks the new kernels
bitwise against the per-token ones, and --window-hashes writes a hash of
each window's final residual rows so two builds can be compared end to end.
Inference engine, OpenAI/Anthropic API on localhost, optional image input, one-file setup
(START-HERE.bat / setup.sh). Model files are downloaded from Hugging Face by the setup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0154bwiad8gY7wRehCXy27pN