Archived
gemm_w4a8i8_tiled / gemm_w5a8i8_tiled ran one 256 x 64 tile, built for 2048-row prefill chunks. At decode row counts its time is the weight's trip through the block and is flat in M (N=5120 K=17408: 272 us at M=32, 284 at M=256): a 128-row step computes half padding, and N/64 blocks (80 at N=5120) leave most of an R9700 idle. The kernel is now templated on its tile (TM x TN fragments a wave, WM x WN waves a block), with the body unchanged, and the rows gain one tunable axis, `arm`: 0 is the prefill tile (the old constants, so an untuned install runs the same kernel), 1-8 are 128-, 64- and 32-row tiles. tools/opshapes.cpp describes the int8-activation operands so rad-tune can walk the axis, and r4d_selftest checks every arm against the host reference for int4 and int5, with ragged M and a partitioned weight; --perfwpa takes R4D_PERF_ARM. Tuned on an R9700 at the trunk shapes of Qwen3.8-27B ParoQuant int5 (rad-tune, us, arm 0 -> the tuned arm): shape M=32 M=64 M=128 N=16384 K=5120 258 -> 72 229 -> 97 233 -> 151 N=5120 K=6144 101 -> 38 101 -> 42 101 -> 62 N=34816 K=5120 497 -> 217 494 -> 234 504 -> 309 N=5120 K=17408 273 -> 89 275 -> 103 277 -> 168 N=12288 K=5120 167 -> 52 167 -> 72 168 -> 112 N=1024 K=5120 36 -> 21 36 -> 22 37 -> 24 The prefill band (M=2048) keeps arm 0. Which rows reach this kernel is unchanged: the qwen35 plugin still hands the rotated int4/int5 linears to it above 64 rows, so the M=32/64 columns only bound what a lower handover could gain. The int4 rows share the kernel and gain alike (int4 x int8 at M=128, arm 0 -> best: N=5120 K=17408 267 -> 150 us, N=34816 K=5120 444 -> 248, N=16384 K=5120 211 -> 118, N=12288 K=5120 160 -> 91). End to end, Qwen3.8-27B ParoQuant int5 + DFlash2 on one R9700 (k6_v4 cache, f16 state, depth 3, 32 sequences of ~3k shared + ~2.5k unique prompt, 3000 tokens out, so 128-row verify steps), against origin/main on the same boot and tune cache: mean decode step 111.0 -> 93.8 ms, decode 467 -> 614 tok/s, wall 345 -> 418, no preemptions. Decode at up to 64 rows (one to eight sequences at depth 7) and prefill (arm 0) run the same kernels as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BxxGmKGSAyx2h88G3sEGp