Archived
libxe2: GDN recurrent state store through local memory, out as whole lines
The register kernel stored a lane's own 512-byte state row, so each float4 store touched 16 cache lines. A sub-group's 16 rows now go through a 9-float4-pitch tile, 32 columns at a time, and out coalesced. Bit-identical (rad-kbench gdn rows rel_l2 0, greedy hashes unchanged). 9B 58.9 -> 59.2 tok/s, 27B 30.4 -> 30.6 (spec off). XE2_GDN_ROWSTORE=1 restores the row store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0aad575475
commit
0a1fed0bcf
2 files changed
+37
-1
No files matched your search
@@ -1061,9 +1061,16 @@ at ~1,170 GB/s (Xe2's lossless compression), so bandwidth probes must use random
|
||||
| 8 | `d35027aa` | split-KV attention up to head_dim 512 (was: the exact kernel above 256); instantiated at 16 and 32 values a lane, head_dim <= 256 unchanged | rad-kbench Gemma 4 attn 320/320 | hd512 decode 192 -> 43 us, q256 55 -> 20 ms; Gemma 4 decode 58.6 -> 63.0, prefill @2.4k 724 -> 1,537 |
|
||||
| 9 | `dd20835f` | sliding-window attention on the DPAS kernels (was: the SIMT kernel for any window), its own instantiation so window 0 is unchanged | Gemma 4 attn 320/320, 9B 160/160 (times = old code within 0.5%), fixture 2144/2144 | window 512 decode 101 -> 23.5 us, q512 2,833 -> 98 us; Gemma 4 decode 63.0 -> 74.4, prefill 1,537 -> 1,886; long-context retrieval checked |
|
||||
| 10 | `9aef2966` | the fused gated-attention prologue `qk_norm_rope_gate(+_kv_store)` (qwen35 family, Qwen4-Exp, FishOmni, MTP heads): q/k norm, partial rope from the `rope_table` plane, kv_store, one launch for five; byte-identical to libxe2's unfused ops, schemas libr4d's; the `_kv_store` row declares its chain and both describe their operands | rad-kbench fusion oracle 28/28 byte-identical on the 9B and the 27B; fixture 2144/2144; greedy hashes identical with and without, both models | 9B decode 58.3 -> 58.9 tok/s, 27B 30.1 -> 30.4 (spec off); prefill unchanged |
|
||||
| 11 | (this commit) | the GDN register kernel's state store through local memory: a sub-group's 16 state rows, 32 columns at a time, out as whole cache lines instead of a lane's own 512-byte row (16 lines touched a store instruction); the loads stay a lane's row (coalescing them gained nothing in probe gdnd.cpp) | rad-kbench gdn rows rel_l2 0 (fixture 15/15, 9B 40/40); greedy hashes identical, both models | probe (27B decode shape, cold state) 24.9 -> 21.2 us a call; 9B decode 58.9 -> 59.2 tok/s, 27B 30.4 -> 30.6 (spec off, A/B x2); prefill unchanged |
|
||||
|
||||
Escape hatches: `XE2_ATTN_SIMT=1`, `XE2_GEMV_SIMT=1`, `XE2_W4_RB8=1` restore the previous forms;
|
||||
`XE2_EXACT=1` the ref rows of 4; `XE2_NO_FUSED_PROLOGUE=1` leaves the rows of 7 and 10 undeclared.
|
||||
`XE2_EXACT=1` the ref rows of 4; `XE2_NO_FUSED_PROLOGUE=1` leaves the rows of 7 and 10 undeclared;
|
||||
`XE2_GDN_ROWSTORE=1` restores 11's row store.
|
||||
|
||||
**The GDN decode floor** (probe gdnd.cpp, 27B shape: 48 heads x 64 KB of f32 state, read and written): a plain
|
||||
read-modify-write of the same 6.3 MB with random data takes 12.3-13.8 us at any thread count (a constant fill
|
||||
reads 8.4 us: the card compresses it), so ~13-15 us a call is the floor, not the ~7-10 us estimated before; the
|
||||
rest of the 21 us is the load -> serial libref chains -> store order a thread must keep.
|
||||
|
||||
**27B re-bench at `47d1a952`** (bench-standard quick, spec off, run 11): decode 29.7 tok/s, prefill
|
||||
1,443 / 1,068 tok/s at 2k / 64k, greedy hash `ac03957082a0` -- the same as run 5 at `6abca01f`, so
|
||||
|
||||
Reference in new issue
Block a user