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