- 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>
Conflicts from the old m2xfp branch take upstream's version. Two libxe2 fixes the merge needs:
- rad_plugin_abi_layout: the plugin now exports the ABI layout hash the loader checks.
- gemm_nt_q_w4a16: upstream 492d33c sends bf16 activations to the w4a16 GEMM (the separate cast
is gone); the fast kernel took only f16, so every call fell back to the exact path (decode
~2.5 tok/s). A bf16 activation is narrowed to f16 (round to nearest even) into a workspace first,
the dropped cast bit for bit; decode back to ~57 tok/s on one request.
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>
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>