The DPAS now leaves sum - zero * asum directly (int16 operands, |zero * asum| <= 15*127*128),
so the epilogue is a convert and the two scalings: no zero-init move, no f32 multiply and
subtract an element. The same integer, so the same output (2234-token continuation and greedy
8/8 identical).
Probe at M = 2048: gate_up 83 -> 91, inz 81 -> 88, qg 80 -> 87, out 80 -> 86 int8 TOPS.
2234-token prompt 1001 -> 1039 tok/s. (A blocked work-group order and an L1 prefetch of the
codes were tried: neither helps; down at K = 17408 stays at ~66.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stall samples put ~75% of the prefill GEMM in its per-group epilogue (128-wide broadcast
copies and int32 multiplies), not the DPAS. sum, zero * asum and their difference are integers
under 2^24, so forming them in f32 a row at a time gives the same values: byte-identical output
(kbench 2676/2676, greedy 8/8 identical).
Probe at M=2048: gate_up 76 -> 83, inz 75 -> 81, qg 74 -> 80 int8 TOPS. BetterBench prefill
@2000 931 -> 957 tok/s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- gdn_kkt_solve on DPAS (~0.4 ms at 2048 tokens against 7.7), the int8 head's DPAS forms at 9-16
rows (verify past depth 7), the plain block norm (RadBuildCtx::plain_norm, set on the SYCL
backend: `add` + `rmsnorm` where no reader takes the E4M3 codes) with the fast rmsnorm rows.
- rmsnorm's bf16 rows up to 8192 wide: a work-item eight elements by one 16-byte load (the generic
form walked 20 dependent loads a work-item): 24.7 -> 3.3 us a decode norm, ~3.5 ms a round.
- w4a16: a bf16 activation narrowed to fp16 at the kernel's own load (the separate cast launch
before every GEMM is gone), bit for bit the same.
- RADIANCE_MTP_DRAFT_VOCAB=N: the 2-bit draft head over the vocabulary's first N ids (a prefix
shortlist, GRIMOIRE's idea); the u2 layout hook takes an op N below the weight's rows. 131072:
greedy acceptance identical on the decode proxy, draft head 650 -> 351 us a pass.
KL against the exact-kernel reference (2002 positions): 0.002386, top-1 97.30% (was 0.002376 /
96.80%). Decode proxy (greedy, depth 5, mtp4): 72.0 -> 74.3 tok/s with the prefix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first form ran a thread a (tile, split) and a separate reduction launch over partials in global
memory, and kept narrow-N shapes on one split (too few threads to fill the card). Now a tile's splits
are one work-group whose partial sums meet in local memory, added in split order, and S is the
divisor of the group count closest to 8 groups a thread. Probe w4d.cpp at M = 4: gate_up 190-208 ->
162 us, N 16384 125-147 -> 79, N 12288 108-117 -> 61, down 148 -> 83, N 5120 K 6144 35 (+ reduce)
-> 32, N 1024 10 (+) -> 7.4 -- the weights at the card's ~560 GB/s.
XE2_W4_CHECK on the 27B (M = 5): 10 of 81920, 6 of 25600 and 14 of 174080 bf16 outputs differ from
libref's loop (ties; rel_l2 <= 1.8e-5); greedy text unchanged; dec_quick.py 46.3 -> 48.5 tok/s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first form gave each thread 32 rows by 32 columns in 256 registers and its own 2D loads of the
activation: 23-29 TOPS at M = 2048 (probe w4p.cpp), and the probe's breakdown put the time in the
activation loads, then the group epilogue (DPAS alone ran 120 TOPS). Now a work-group of 8 threads
shares 16 rows: each group's activation is staged in local memory once, double-buffered, a step
a 2D load; a thread owns 16 rows by 32 columns in 128 registers (8 threads an EU) and runs the
group's epilogue on whole [8 rows][16] blocks against factors broadcast once; for outputs wider than
8192 the work-groups go rows fastest, so one 256-column slice of the weight stays in L2 while every
row block uses it. TOPS at M = 2048: gate_up 27 -> 78, N 16384 K 5120 27 -> 75, down 24 -> 62,
N 5120 K 6144 29 -> 78. The chain is unchanged: still libref's result bit for bit (XE2_W4_CHECK on
the 27B: 0 of 349568, 327680 and 445696 outputs differ).
quant_act_i8g for bf16 rows in groups of 128 reads a lane's 8 values in one 16-byte load and stores
its 8 codes in one 8-byte store, typed (677 us a call at 2048 x 5120 through the generic accessors);
the same floats and rounding: rad-kbench fixture 153/153 and the 27B 96/96, rel_l2 0.
Prefill, 2234 tokens: 7.68 -> 5.90 s (378 tok/s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For qwen3.8-27b-w4a16-rtn (u4 codes, f16 scale and u4 zero per 128 of K): the engine casts a
linear's input to f16 for gemm_nt_q at w4a16_asym up to 64 rows a step, and quantises it with
quant_act_i8g for w4a8i8_asym above. None had a device kernel.
- The planes are stored tiled at load (xe2_ops.h, w4_tiled): a 16-column tile's codes side by
side, the even codes of each dword in its low half so (w >> 4s) & 0x000F000F is a VNNI pair, and
the scale with f16(1024 + zero) one dword a (column, group). unrelayout inverts both exactly.
- gemm_nt_q_w4: libref's gemm_zp loop per output, the exact form (XE2_EXACT=1, XE2_W4_EXACT=1).
- w4a16_asym, M <= 64: ESIMD, a thread a tile; (code | 0x6400) less f16(1024 + zero) is
code - zero exactly; eight fp16 DPAS of RC = 1, 2, 4 or 8 rows a group, scaled in f32 a group.
Narrow outputs split K. Probe w4d.cpp, incompressible codes: gate_up (N 34816, K 5120) 173 us at
M = 1 (546 GB/s), 190 us at M = 4.
- w4a8i8_asym: int8 DPAS takes the tiled codes as its u4 B operand (nibble i meets A's byte i), so
a prepass reorders the activation's bytes of each 8 evens first and forms each group's sum of
codes; the group's integer sum is exact and its term ((sum - zero * asum) * a_scale) * scale is
added in group order.
- quant_act_i8g: quant_act_fp8's form at libref's int8 rule (top 127).
rad-kbench and the op oracle cannot draw the zero-point grids, so XE2_W4_CHECK=n checks the first
n calls of each form against libref's loop on the host, on the engine's operands. On the 27B: the
exact form 0 of 81920 and 0 of 25600 outputs differ; w4a8i8 (M = 2048) 0 of 349568 and 0 of 327680;
w4a16 (M = 4) 0 of 65536 and 2 of 20480 (bf16 ties, rel_l2 5e-9). quant_act_i8g: rad-kbench
fixture 153/153 (quant_act*), the 27B 96/96, rel_l2 0. ctest -L sycl 3/3; the host tier's five
failures are the baseline's (FFmpeg, CPU budgets).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>