Commit Graph
54 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 55db8c7c65 libxe2: gdn's gated norm a sub-group a (token, head) -- 31.8 -> 24.9 us a call
One wave of Tk * Hv threads with a row's V columns in each lane's registers, instead of a 128-item
work-group a row (~2.4 waves). The sum over e is the same chain in e order; the amax a maximum.
Greedy output identical (8/8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 19:51:43 +01:00
claudeandClaude Opus 5.5 d87dd860ce libxe2: gdn recurrent state rows loaded and stored as a lane's own 16-byte vectors -- 50 -> 28 us a call
The 16-row block staged through local memory took 8.3 KB a 16-lane work-group, so only ~300 of the
384 work-groups fit the card at once and each phase ran in two waves (probe rec2.cpp: 39.6 vs 24.7
us for the 8-token pass). Same values into the same registers: greedy output identical (8/8); a
round's device time 75.8 -> 72.8 ms (unitrace, story prompt).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 19:35:14 +01:00
claudeandClaude Opus 5.5 2a5e815a95 libxe2: w2a8 head -- 64 threads share the staged activation, a group's codes one load: 1.66 -> 0.74 ms
Work-groups of 16 threads staged the 40 KB activation into local memory for 16 tiles each; 64
threads amortise it over four times the columns (16: 1.66 ms, 32: 0.96), and a group of 128 reads
its four steps' codes as one 512-byte block load (32: 0.77, 64: 0.74 ms in the round, unitrace -d).

Checked as before: 20 calls on the engine's inputs against the SIMT GEMV, 0 of 1738240 outputs
differ each; greedy output identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 03:43:51 +01:00
claudeandClaude Opus 5.5 34ae231e97 libxe2: the w2a8 draft head on int8 DPAS with u2 B operands, codes tiled at load -- 2.56 -> 1.66 ms
This card's DPAS takes 2-bit B operands against s8 A, 16 codes a dword from the low end (probe
dpas_u2.cpp), so the drafter's 2-bit vocabulary head needs no decode: gemm_zp_layout stores the u2
codes tiled ("xe2.zp.u2.t16": a 16-column tile's 32-column step is 128 bytes, [dword][lane],
each dword the column's codes at the activation's stored positions -- quant_act_i8's step order is
folded into the layout), and an ESIMD kernel (xe2_gemm_zp_esimd.cpp) feeds them to DPAS as they
lie, against the activation staged in local memory as the A operand. Each group's sum is exact
in int32 and the terms are added in group order, as zp_dpas and libref do. The exact kernel and
the SIMT GEMV read the tiled form too.

Checked: 20 calls on the engine's real inputs, the ESIMD kernel against the SIMT GEMV on the same
bytes, 0 of 1738240 outputs differ each; greedy output identical (rad-kbench has no w2a8 recipe
on this container).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 03:18:30 +01:00
claudeandClaude Opus 5.5 ed8e26c2fc libxe2: quant_act_fp8 a sub-group a (row, group) -- 49.6 -> 8.0 us at n=17408
A row's work-group walked its groups sixteen at a time, ~5 us a group of dependent loads,
reduction and stores. The groups are independent, so each sub-group now takes one (as
gated_quant_fp8 already does); the arithmetic is unchanged. rad-kbench against libref: 45 checked,
45 passed, rel_l2 0. Greedy output identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 02:20:16 +01:00
claudeandClaude Opus 5.5 dad30c6b59 libxe2: m2xfp4 meta and exponents tiled too, each column's max exponent stored at load -- gate_up 222 -> 205 us
Where N % 16 == 0 and K % 512 == 0 the meta bytes (in the codes blob) and the E8M0 plane (b_scale,
tag "xe2.m2.e8m0.t16") are stored in chunks of a tile's 16 groups, [dword][lane], so the ESIMD
kernel reads four steps of them with one block load each instead of gathers across 16 rows. The
exponent plane's stored form appends each column's largest exponent (int32), computed once at
load, so the prepass no longer scans the plane on every call; unrelayout drops it and untiles the
exponents exactly. Every m2 reader reads the tiled forms.

rad-kbench against libref: 70 checked, 70 passed (worst rel_l2 1.2e-3). M = 8: gate_up 222 -> 205,
down 119 -> 113 us; prefill shapes flat to -5%. Greedy output identical; 512-token decode 33.3 ->
33.9 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 02:06:52 +01:00
claudeandClaude Opus 5.5 68d510b1f4 libxe2: m2xfp4 codes stored tiled at load -- the verify GEMM's step one block load, gate_up 240 -> 222 us
Where N % 16 == 0 and K % 128 == 0 the layout hook asks for "xe2.m2.tiled16": a 16-column tile's
128-column step is 1 KiB, dword w of its columns side by side, the ESIMD kernel's [word][lane]
registers as they lie (four block loads in place of four d32x4 gathers). M = 1 goes to the same
kernel when tiled. Every m2 reader in libxe2 (exact, SIMT GEMV, jm and SIMT DPAS forms, prefill
decode) reads the tiled form; unrelayout inverts it for the oracle.

rad-kbench against libref: 70 checked, 70 passed (worst rel_l2 1.2e-3). M = 8: gate_up 240 -> 222,
down 140 -> 119, N=1024 50 -> 25 us. Greedy output identical (8 prompts x 64 tokens); 512-token
decode 31.8 -> 33.3 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-26 01:47:12 +01:00
claudeandClaude Opus 5.5 340231d007 libxe2: verify GEMM loads exponents and metadata four steps a gather -- down 142 -> 131 us
EU stall sampling (unitrace --stall-sampling) put 43% of the kernel's samples on send stalls, the
memory request queue full, not on waits for data: 4-byte gathers of the exponents and metadata
were a third of its cache-line requests for an eighth of its bytes. 16 bytes a lane now cover
four steps; a split's tail keeps the per-step gathers, so the arithmetic and splits are as
before. rad-kbench against libref 50/50; greedy output identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-25 14:21:03 +01:00
claudeandClaude Opus 5.5 70e50f4758 libxe2: w2a8 head stages its activation with every load before the local stores -- 2.81 -> 2.55 ms
The pair-a-step staging loaded through a generic pointer after each local store, one round trip
an iteration. Same arithmetic; greedy text and speculative round count unchanged (rad-kbench has
no recipe for the shape).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-25 13:53:52 +01:00
claudeandClaude Opus 5.5 36b8941096 libxe2: the verify GEMM's e_max in the prepass launch -- down 156 -> 142 us at M=8
The per-column largest exponent was a kernel of its own for split-K shapes (7.8 us a launch, 260
a round) and an in-kernel scan otherwise; extra work-groups of the activation prepass now form it
and the ESIMD kernel gathers it. rad-kbench against libref 50/50; greedy output identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-25 13:12:30 +01:00
claudeandClaude Opus 5.5 fc1f2bba59 libxe2: the m2xfp4 verify GEMM in ESIMD -- gate_up 403 -> 256 us at M=8
A thread owns 16 columns as [word][lane] registers, so a decoded weight pair is one SIMD32 fp16
multiply instead of SIMT's ~10 instructions; the step's activation blocks load with the code
lines, so no DPAS waits on its own A load. rad-kbench against libref 50/50; greedy output
identical. XE2_M2_SIMT=1 keeps the SIMT kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-25 11:13:28 +01:00
claudeandClaude Opus 5.5 5010e1d083 libxe2: gdn recurrent update issues its state loads before the local stores -- 234 -> 166 us a call
The state pointer is generic, so IGC ordered every load behind the preceding local store and the
128 loads of a row block each paid a full memory round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-25 11:13:28 +01:00
claudeandClaude Opus 5.5 55a1e9f110 libxe2: gdn_conv_prep's conv and l2 norm typed for bf16 -- 0.46 -> 0.26 s a 1882-token prefill
The conv takes typed loads and stores when its operands are bf16 (the engine's), and the l2 norm
over each 128-wide q/k head is a sub-group's: its values loaded 8 a lane, the squares added in d
order by lane broadcasts -- libref's chain -- instead of a work-item walking the head twice through
the generic accessors. Fixture 90/90 at rel_l2 0. Prefill 336 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 19:07:36 +02:00
claudeandClaude Opus 5.5 ecf8bf547a libxe2: gdn_conv_prep a work-item a (token, channel) and gdn_gated_rmsnorm's row staged -- 0.54 -> 0.46 and 0.38 -> 0.20 s a 1882-token prefill
conv_prep walked each channel through every token (10240 chains of 1882) and the gate cumsum on 48
work-items; every (token, channel) output is independent and the cumsum restarts each chunk, so
they now take a work-item a (token, channel) and a (head, chunk). The gated RMS norm's work-item 0
summed its row from global memory one load at a time; the row is staged in local memory first.
Same expressions and order: fixture 90/90 at rel_l2 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 18:51:28 +02:00
claudeandClaude Opus 5.5 bbc7607222 libxe2: rmsnorm_quant_fp8 keeps a row's values in registers -- 0.30 -> 0.16 s a 1882-token prefill
A sub-group now loads the 128-groups it later quantises, so the normed inputs and the gain stay in
its registers between the ordered sum and the codes; only the squares go to local memory. Three
n-wide arrays (60 KB at n = 5120) allowed two rows on a Xe core at once, and a row's sum is a
serial chain, so the prefill's 941-row calls ran as ~24 waves of it. Bit-identical: fixture 20/20
and 400/400 live oracle issues at rel 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 17:57:05 +02:00
claudeandClaude Opus 5.5 a7868f37f3 libxe2: givens_dense_quant in one register-DPAS pass at every row count -- 0.74 -> 0.52 s a 1882-token prefill
The prefill rotation ran three passes (an fp16 copy of the input, a strided batch GEMM, the
quantiser) over sizeable intermediates. The decode form -- a (part, group)'s rotation on dpas_f16
with the quantiser after it -- now takes any row count, a work-group a 16-row block. The same
arithmetic as the batched form (fp16 input, f32 sums): 200/200 live oracle issues agree (rel at
most 4.5e-3, p99 5.6e-4). XE2_GIVENS_BATCHED=1 keeps the three-pass form. Prefill 316 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 17:51:42 +02:00
claudeandClaude Opus 5.5 9da46ab7fe libxe2: prefill GEMMs on oneMKL -- 27B prefill 208 -> 305 tok/s
oneMKL's SYCL GEMM (part of oneAPI; libxe2 links it when CMake finds it, RAD_XE2_MKL=OFF or
XE2_NO_MKL=1 keep the hand-written kernels) runs the fp16 prefill GEMMs at 85-91 TFLOPS on random
data at the 27B's shapes, deterministic run to run, against ~23-30 for the hand-tiled XMX kernel:
xmx_f16_scaled (the m2xfp4 prefill) and xmx_f16_batched (the rotation's) go to its gemm and
gemm_batch, and bf16 gemm_nt at M >= 17 to its bf16 GEMM (N = 96 had fallen to the exact kernel,
5 ms a call). The m2xfp4 weight decode to fp16 now takes a (column, 32-group) a work-item. fp16 or
bf16 products with f32 accumulation, as before: the 27B's cases 133/133 (rel_l2 <= 1.42e-3), the
fixture 1410/1410. Prefill GEMMs over a 1882-token prompt 4.06 -> 1.66 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 17:49:44 +02:00
claudeandClaude Opus 5.5 b66b1243d2 libxe2: gdn_kkt_solve on 512 work-items -- 0.45 -> 0.33 s a 1882-token prefill
Two of its 48 KB work-groups fit a Xe core; 512 work-items each fill its threads. Same chains:
fixture 90/90 at rel_l2 0. 27B prefill (1882 tokens) now 202 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 16:34:12 +02:00
claudeandClaude Opus 5.5 9a9c831f79 libxe2: gdn_chunk_scan on 1024 work-items a work-group -- 2.68 -> 0.92 s a 1882-token prefill
The chain-parallel scan's ~124 KB of local memory leaves one work-group a Xe core, and at 256
work-items that left three quarters of the core's threads idle. Every phase is a set of independent
chains strided by the work-group size, so the work-group is now the core's 1024: the same chains in
the same order, fixture 90/90 and 72/72 on the 27B at rel_l2 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 16:30:37 +02:00
claudeandClaude Opus 5.5 1a61aac915 libxe2: gdn_kkt_solve a work-group a chunk, row terms spread over 256 work-items -- 1.51 -> 0.45 s a 1882-token prefill
kkt walked a head's chunks and rows in turn on 48 work-groups, its working rows in global
memory. Chunks are independent here: a work-group now takes one (sequence, head, chunk) with the
chunk's k rows in local memory, forms every row term beta_i (k_i . k_j) e^{g_i - g_j} first (each
its sum over d in order, 256 work-items), then solves row by row from local memory. libref's chains
and order: fixture 90/90 at rel_l2 0. (Measured on the way: the double exp is not the cost; k as
f32 in local memory halves the resident work-groups and is slower.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 16:21:01 +02:00
claudeandClaude Opus 5.5 905a7ec242 libxe2: gdn_chunk_scan with typed loads for the engine's bf16/f32 operands -- 4.8 -> 2.7 s a 1882-token prefill
The chain-parallel scan staged each chunk's k, q, v, A, g and beta through the generic accessors
(a dtype switch an element); bf16 q/k/v/A/o with f32 g, beta and states now take typed loads and
stores. Same arithmetic: fixture 90/90 at rel_l2 0. 27B prefill 131 -> 153 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 15:55:38 +02:00
claudeandClaude Opus 5.5 99fb3108cd libxe2: the w2a8 draft head on register int8 DPAS -- 4.2 -> 3.05 ms a round
dpas_s8u8 (xe2_common.h: SPV_INTEL_subgroup_matrix_multiply_accumulate's int8 form, K = 32, A
signed, B unsigned; layout checked in a probe) takes a lane's column of codes as B straight from
registers, so the group sums no longer go through a local-memory tile and two sub-group barriers a
step; the activation is staged once a work-group as A columns, and a step's codes are one 8- or
16-byte load. The group terms are libref's, in order, as before: bit-identical to the
libref-checked sub-group form on 50/50 live calls (a temporary cross-check), fixture 228/228.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 15:46:35 +02:00
claudeandClaude Opus 5.5 531146b4e8 libxe2: split-KV attention keeps 64 keys a partition and skips the empty ones -- 212 -> 114 us a verify call
At a verify's 8 rows and a ~300-token context the 32 partitions held ~10 keys each, and every one
loaded the query, wrote a full state and was merged. A partition now takes at least 64 keys; the
ones past a row's keys write only an end marker (l = -1) and return, and the merge stops at it.
Tolerance-held as before: fixture 158/158 (rel_l2 <= 2.9e-4), the 27B 124/124.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 15:23:51 +02:00
claudeandClaude Opus 5.5 5092098123 libxe2: gdn_conv_update with typed loads for bf16 operands -- the fused update 272 -> 238 us a verify call
The conv's per-element generic accessors (a dtype switch each) cost it ~60 us at 8 tokens; the
engine's operands are all bf16, which now take a typed copy of the same loop (libref's double exp
in silu kept). Bit-identical: 252/252 live gdn_conv_recurrent_update and 48/48 gdn_conv_prep oracle
issues at tolerance 1e-9, fixture 90/90. XE2_GDN_GENERIC=1 keeps the generic forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 14:59:05 +02:00
claudeandClaude Opus 5.5 c036bfcb88 libxe2: m2xfp4 verify GEMM reads e_max itself and stores y when K is not split
The register form spent ~60 us a call in launches around it: e_max over the weight's exponents, a
finalize over the partials, and an activation prepass on 8 work-groups. A lane now reads its
column's exponents for e_max, an unsplit launch stores y with its factors directly, and the
prepass runs a work-group a (row, 2048 columns). N=34816 463 -> 400 us, N=5120 K=17408 249 ->
207, N=16384 247 -> 216, N=5120 K=25600 373 -> 303. Same arithmetic: 185/185 model cases, worst
rel_l2 1.46e-3 as before. Tried and slower: the activation staged in local memory a split at a time
(96 KiB a work-group starves occupancy: 1585 us) or a step at a time behind a barrier (506 us).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 14:51:18 +02:00
claudeandClaude Opus 5.5 6579556715 libxe2: givens_dense_quant on register DPAS for rows <= 16 -- 64 -> 24 us a decode/verify call
At a verify's 8 rows the float-pair form ran 80 work-groups (n=5120, two parts), each walking its
rows in turn. A (part, group)'s rotation is now one small GEMM on dpas_f16: the rows' inputs
fp16(x / D) in local memory as A columns, a lane's B column its output's row of T, T read once for
every row; then libref's quantiser. The prefill form's arithmetic (fp16 activation, f32 sums), held
to the same tolerance: 400/400 live oracle issues agree (rel at most 4.5e-3, p99 4e-4). Per
speculative round 18.5 -> ~5.5 ms. XE2_GIVENS_PAIR=1 keeps the float-pair form (rel 0).

Also: the BetterBench row for b0e34c6 (decode 28.9, prefill 131.3 @2000) and the round's notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 14:27:06 +02:00
claudeandClaude Opus 5.5 c55ca689fe libxe2: m2xfp4 verify GEMM on register DPAS -- no local-memory round trip
SPV_INTEL_subgroup_matrix_multiply_accumulate gives DPAS on operands in registers (dpas_f16 in
xe2_common.h; libxe2's link enables the extension). Its B operand is a lane's column as dwords of
fp16 pairs, which is what a lane decodes from its codes, so the 2 <= M <= 16 m2xfp4 GEMM no longer
writes the decoded weights to local memory and reads them back as a joint_matrix tile; the
activation is transposed once so a lane's A column is one 16-byte load. 15-20% a call at M = 8
(N=34816 K=5120 518 -> 463 us, N=5120 K=17408 312 -> 249 us). Same products: rel_l2 at most
1.46e-3 as before (185/185 model cases). XE2_M2_JM=1 keeps the local-memory form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 13:56:02 +02:00
claudeandClaude Opus 5.5 0709322819 libxe2: gdn recurrent update with typed operands and coalesced state rows -- 700 -> 285 us a verify call
The register kernel read every element through the dtype-switching accessors, so a row's 128
state loads did not issue together, and a lane stored its own row 512 bytes from its neighbours.
It is now templated on the staged q/k/v type and, for an f32 state with contiguous rows, moves a
work-group's 16 rows through local memory in coalesced lines. The anchor replay's decays are
taken one token a lane. At the speculative verify (8 tokens): the 8-token pass 408 -> 101 us, the
replay 222 -> 110 us; 48 calls a round, 32.7 -> ~13 ms. Bit-identical to libref (fixture 90/90 at
rel_l2 0, 400/400 live oracle issues).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 12:42:02 +02:00
claudeandClaude Opus 5.5 71356b773e libxe2: rmsnorm_quant_fp8 with 16-byte loads for bf16 rows -- 112 -> 44 us a call
Half the norm's time was its per-element loads of x, the residual and the gain. bf16 rows (gain
bf16 or f32) now load and store 8 values at a time and a 128-group's codes go out 8 bytes a lane;
the arithmetic and the ordered sum are the general form's. Bit-identical to libref (kbench rel_l2
0; 408/408 live oracle issues). 128 calls a speculative round: 17 -> 6.5 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 12:01:34 +02:00
claudeandClaude Opus 5.5 ea25b98e23 libxe2: 8-row bf16 GEMMs and the E4M3 logits head on XMX
At M <= 8 the bf16 GEMV re-read the activation for every column; it now stages 8 rows in local
memory and runs bf16 DPAS against the weight, K split to fill the card: N=96 164 -> 20 us. The
joined E4M3 head decodes its codes by bits into a packed fp16 tile and runs fp16 DPAS, a scale
block's sum scaled per column in f32: 9.7 -> 3.5 ms at M = 8, and 3.9 -> 3.4 ms at M = 1, so decode
takes it too. Held to the gemm tolerance (rel_l2 1.6e-3, as before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 12:01:34 +02:00
claudeandClaude Opus 5.5 99fd4ea59a libxe2: the speculative round's selection ops -- w2a8 head on int8 DPAS, dflash_select a sub-group a sequence, row_topk in two stages
The DFlash2 drafter's 2-bit vocabulary head (N=248320) forms each group's integer sum on int8 DPAS
(8 x 32 by 32 x 16), the u2 codes unpacked straight into the packed B tile; a lane owns a column
and adds libref's group terms in order: 24.0 -> 4.2 ms a round, bit-identical to the libref-checked
sub-group form on 63 live calls. dflash_select scores the 16 candidates in parallel lanes, each in
libref's order, lane 0 taking the first strict maximum: 11.6 -> 0.5 ms. row_topk takes each of 128
chunks' top R, then the top R of the winners: 3.2 -> 0.95 ms. Both exact against libref (fixture,
engine oracle).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 12:01:34 +02:00
claudeandClaude Opus 5.5 db9a464ac4 libxe2: attention value rows 16 bytes at a time at head_dim 256 -- 2.72 -> 0.88 s a 27B prefill
The lane-per-key attention read bf16 value rows with 16-byte loads only at head_dim 128; at 256
(Qwen3.8's full attention, 16 dims a lane) every element went through the generic loader. Two
16-byte loads a lane now. rad-kbench 138/138 on the fixture and 33/33 on the 27B (worst rel_l2
1.5e-4). SYCL_PROGRESS records the first 27B BetterBench run (5720a95): decode median 19.1 tok/s,
prefill 113.4 tok/s at 2000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 06:28:35 +02:00
claudeandClaude Opus 5.5 c571fa36b3 libxe2: givens_dense_quant on XMX for prefill rows -- 2.07 -> 0.70 s over a 1792-token prefill
For 17 or more rows the rotation is a batch of GEMMs, one a (part, 128-column group): the input
fp16(x / D) per part, the f16 rotation as B, a batched form of the tiled fp16 XMX kernel
(xmx_f16_batched) into f32, then libref's quantiser a (row, part, group). The input rounded once
to fp16 where libref sums in double: a fast kernel. KL against the exact reference: mean 0.0037,
top-1 97.2% (0.0035 / 95.6% before: within the noise of 250 positions). Up to 16 rows the float-pair
kernel stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 05:55:19 +02:00
claudeandClaude Opus 5.5 3b30d7803b libxe2: a local-memory-tiled fp16 XMX GEMM for the m2xfp4 prefill -- 27B prefill 91 -> 105 tok/s
xmx_f16_tiled: a 128 x 128 work-group tile, 4 x 2 sub-groups of 32 x 64 (16 accumulators, the
large register file), K in steps of 32 with A and a VNNI B staged in local memory, double
buffered, each sub-group's A tiles loaded once a K16 step; the accumulators stored straight to an
f32 scratch and scaled into y by a second kernel (a generic store in the epilogue spilled them and
ran 3x slower than the old tiling). ~30 TFLOPS on the 27B's prefill shapes in a standalone probe
against ~18 / ~11 for the previous per-sub-group tiling (the card's measured fp16 DPAS peak: ~98).
gemm_nt_q over a 1792-token prefill 6.4 -> 3.7 s. KL against the exact reference unchanged (mean
0.0035, top-1 95.6%): the same products.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 05:49:41 +02:00
claudeandClaude Opus 5.5 e9b2714081 libxe2: chain-parallel gdn_chunk_scan and an fp16 m2xfp4 prefill -- 27B prefill 68 -> 91 tok/s
- gdn_chunk_scan for head_k = 128, chunk 64: a work-group of 256 a (sequence, head, block of 32
  value columns), the chunk's k, q (rows padded), the block's slices of v, S, W, V' and the sA rows
  in local memory (~124 KB); every phase of a chunk is thousands of independent chains -- W[j][e],
  V'[i][e], R[i][j], O[i][e], S[d][e] -- each one work-item's, in libref's order, A staged in local
  memory, the decays e^{g_i - g_j} (libref's double exp) once a call. Still bit-identical (rel_l2 0,
  the 27B's geometry, 1..32 rows and multi-chunk). 233 -> 96 ms a call at 1792 tokens.
- m2xfp4 at M >= 17 now fp16 on XMX: the weight times 2^(127 - e_max(n)), exact in fp16; the
  activation fp16(a * a_scale / R_m); y = acc * R_m * 2^(e_max - 127) in a new scaled fp16 XMX
  kernel (xmx_f16_scaled). fp16's 2^-11 step instead of bf16's 2^-8.

KL on the 27B against an XE2_EXACT=1 reference (every kernel exact, each matched to libref bit for
bit; 250 positions, full vocabulary): mean 0.0041 -> 0.0035, p99 0.027 -> 0.021, top-1 96.8% ->
95.6%, PPL ratio 0.998. The fast set's KL is dominated by the model's own fp8 activation quantiser
re-rounding small upstream differences.

27B prefill of 1792 tokens: 26.3 -> 19.7 s (68 -> 91 tok/s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 05:33:08 +02:00
claudeandClaude Opus 5.5 0ffac0ee38 libxe2: the gated delta net's recurrence with its state in registers -- still bit-identical
For head_k = 128 each lane keeps its value column's 128 state values in registers (the 256-entry
register file, grf_size<256>), k and q spread over the sub-group and read by compile-time
broadcasts; every chain over d is libref's, in order. rad-kbench on the 27B's geometry (48 heads,
128 x 128, anchor form, q_len 1..16): rel_l2 0. gdn_conv_recurrent_update 243 -> 173 us a call in
plain decode, ~1000 -> 651 us at the verify width. XE2_GDN_SLM=1 keeps the local-memory form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 04:43:11 +02:00
claudeandClaude Opus 5.5 bce0f4db70 libxe2: the DFlash2 path fast -- exact draft head, DPAS verify GEMV, parallel rerank
- gemm_nt_q over the zero-point grids at M <= 16 (the drafter's 2-bit vocabulary head, N=248320):
  a sub-group a column, the group sums exact integers in f32, libref's group terms added in group
  order through lane broadcasts -- bit-identical to the exact kernel on the live head (checked in
  the engine: 0 differing bytes of 3.5 MB, every round). 252 ms -> well under 1 ms a call.
- m2xfp4 at 2 <= M <= 16 (the verify width) on XMX: a lane a column decodes its codes a 64-byte line
  at a time into its sub-group's VNNI slice of local memory (subnormal-bit fp16 pairs times
  (1 + k/4) * 2^(e - e_max + 14)), eight K16 DPAS a step against the permuted fp16 activation,
  K split for narrow N, partials added in order. On the vector ALUs M = 8 cost five times M = 1;
  gate_up at M = 8 1159 -> ~490 us. rad-kbench on the 27B: 50/50, rel_l2 ~8.5e-4 (tol 4e-2).
- logit_rerank: a work-group a row, a sub-group a candidate along K, libref's double sum as a float
  pair (two-product, two-sum, a fixed lane tree), libref's selection; 136 ms -> negligible a call.
- the gated delta net's gate, beta and decay (libref's double exp / log1p) once a (token, head)
  in a prepass instead of once a column block; still bit-identical (10/10 at rel_l2 0).
- profile_decode.sh: KEEP=DIR keeps the per-geometry tables.

27B on the B65, greedy: 12.1 tok/s plain, 13.2 tok/s with the drafter (device time a token
217 -> 76 ms under speculation). The drafter's text now departs from plain decoding at a
near-tie (byte 246 of 256 tokens): the verify forward runs the M = 8 DPAS path and plain decoding
the M = 1 GEMV, whose roundings differ (~1e-3); with the exact kernels the two were identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 04:37:16 +02:00
claudeandClaude Opus 5.5 15944be7e3 libxe2: fast decode kernels for Qwen3.8-27B-PARO-M2XFP4 -- 0.1 -> 12.1 tok/s on the B65
- m2xfp4 GEMV (M <= 16): e2m1 decoded to fp16 by bits alone ((mag << 9) | sign << 15 is exactly
  e2m1 * 2^-14; the card keeps fp16 subnormals), K permuted (u, u + 4) inside each 8 so a code
  pair is one shift and mask, the activation as fp16(a * a_scale / R * 2^14) in that order, half2
  subgroup and group sums, f32 across groups; four columns a sub-group at decode. The scalar
  form was ALU-bound (~10 ops a weight, 80 ms a token); this one runs at 415-525 GB/s on the
  27B's shapes in a standalone probe. rad-kbench against libref on the container: rel_l2 ~5e-5 to
  ~3e-3, tolerance 4e-2.
- m2xfp4 prefill (M >= 17): the weight decoded to bf16 (exact) and the activation to
  bf16(e4m3 * scale), then the bf16 XMX GEMM per part.
- givens_dense_quant: a sub-group an output, the rotation row read coalesced, libref's double sum
  as a float pair (two-product and two-sum, ~48 bits); the double form stays for XE2_EXACT=1.
  146 -> 5.4 ms a token.
- the joined fp8 head (logits_gemm, M <= 16): E4M3 to fp16 by bits ((b & 0x7F) << 7 is E4M3 *
  2^-8), bytes (0, 2), (1, 3) as half pairs; an i8 head or a narrow scale block element by element.
  43 -> 3.9 ms.
- gated delta net, still bit-identical to libref: the decode step split over 16-column blocks
  (384 work-groups, not 48) with the gated norm in a second kernel and the anchor replay its own
  launch (block 0 rewrites the factors other blocks read); the chunked scan and the kkt solve
  work-group parallel; persistent staging (workspace slots) instead of a malloc and a wait a call.
- rmsnorm_quant_fp8: the row in local memory, loads issued before stores, the ordered sum fed by
  sub-group broadcasts -- still libref's chain (a probe puts that chain's floor at ~32 us for 5120).
- round_dt converts the float dtypes directly.

rad-kbench: 1410/1410 on the fixture; the 27B container's M <= 32 bands 77/77. Decode (greedy, no
speculation) 12.1 tok/s, coherent text; with the DFlash2 drafter 5.3 tok/s and the same text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 03:22:48 +02:00
claudeandClaude Opus 5.5 3158324bdb libxe2: every op Qwen3.8-27B-PARO-M2XFP4 needs, correctness first -- the 27B serves on the B65
Kernels, each libref's arithmetic in libref's order:
- gemm_nt_q at m2xfp4 (xe2_gemm_m2.cpp) with libref's m2 layout hooks, and givens_dense_quant
  (xe2_givens.cpp, the rotation in double as libref's)
- the gated delta net (xe2_gdn.cpp): gdn_conv_prep, gdn_conv_update, gdn_kkt_solve, gdn_chunk_scan,
  gdn_recurrent_update (per-candidate and anchor state forms), gdn_gated_rmsnorm,
  gdn_conv_recurrent_update; each work-item one iteration of libref's parallel loop, the
  per-(sequence, head) workspaces in a shared device workspace (xe2_common: workspace())
- rope's multi-component modes (mrope, imrope, axial) and rope_table
- logits_gemm over an fp8 128x128 joined head, gemm_nt_bias with its epilogue
- mul, sigmoid, scatter_rows, layernorm, grid_embed, attn_dense (the vision tower)
- dflash_conv and logit_rerank (plain and joined head) for the DFlash2 drafter

libref's gemm_m2 gains the parts (pb1/pb2) every other ParoQuant grid and libr4d's mx_parts
already define -- weight rows [0, e1), [e1, e2), [e2, N) read activation copies 0, 1, 2 side by
side -- since this model's fused projections are rotated per piece and the oracle declined them;
its shape hook widens a and a_scale by the part count. Both m2 arms now take the stored
codes-then-meta blob as the engine describes it, u8 [N, K], beside the shape hook's rank-1 form
(libref refused the engine's launch; only libr4d had been run on it).

rad-kbench on the fixture: every new row at rel_l2 0 (90 gdn/givens cases, 108 rope, 80
elementwise, 20 attn_dense, the drafter's and the heads'). On the B65 the model starts with every
op on the card and answers "The capital of France is" -> " Paris.\nThe capital of Germany is
Berlin.\nThe capital of Italy is" (greedy), at 0.1 tok/s: the correctness-first kernels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-24 00:30:40 +02:00
claudeandClaude Opus 5.5 879b9de3ce libxe2: the long-K decode GEMV splits K two ways in the work-group -- decode 55 -> 57 tok/s
At M = 1 a GEMV is N / 2 sub-groups: for down_proj (N=2048, K=6144) that is a tenth of the card's
threads, each walking K alone. With K >= 4096 the work-group's sub-groups now take two halves of K
for the same columns and add the halves in order through local memory (deterministic, one kernel).
Per shape, cold: 59.7 -> 52.2 us; 4-16 ways no better, and splitting the K=2048 shapes slowed them,
so they keep one.

rad-kbench 361/361 and 350/350; KL mean 6.0e-4; greedy against libref 7/8 (the eighth a near-tie).
Decode 57.3 tok/s at a short context, 51.4 after a 1797-token prompt.

SYCL_PROGRESS records the per-shape times, the variants dropped, and what was taken from reading
GRIMOIRE (ideas only: it is GPL-3.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 22:13:39 +02:00
claudeandClaude Opus 5.5 96d785d347 libxe2: the decode GEMV takes two output columns a sub-group -- gemm_nt 9.1 -> 8.5 ms a step
At M = 1 a sub-group now streams two weight rows at once; the band of 2..16 rows keeps one column a
sub-group. The accumulators are sized by the band at compile time, since four columns at sixteen
rows spilled and ran slower than one. Measured at a 1.8k context: one column 9.1 ms of gemm_nt a
step, two 8.5 (~465 GB/s against the ~600 GB/s a plain read kernel reaches on the card, measured
with incompressible data), four 10.9.

rad-kbench 361/361 and 350/350; KL against libref mean 6.0e-4, p99 2.9e-3, top-1 98.4%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 21:09:38 +02:00
claudeandClaude Opus 5.5 c0497e040e libxe2: attention scores a key a lane with 16-byte loads -- decode 32 -> 55 tok/s
Each sub-group now takes sixteen keys a step, one a lane: the lane scores its key in full against
the query in local memory, one max and one sum update the flash state, and the value rows are added
with each key's weight taken from its lane. bf16 cache rows are read 16 bytes at a time, and each
row's own visible span is split evenly 32 ways on the device instead of the context limit (which
left most partitions empty at a short context).

rad-kbench 138/138 and 132/132; KL against libref mean 5.7e-4, p99 3.1e-3, top-1 98.6%.
MiniCPM5-2B on the B65: decode 55 tok/s at a short context and 49 tok/s after a 1797-token prompt
(was 32 and 30); that prompt's prefill 1.62 s, 1109 tok/s (was 4.61 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 20:58:52 +02:00
claudeandClaude Opus 5.5 a71783806a libxe2: the norm and the fp8 quantisers 3-4x faster at decode, still bit-identical to libref
At one row a work-group, rmsnorm_quant_fp8 took 108 us and gated_quant_fp8 84 us a call (26% and 10%
of a decode step at a 1.8k context). The ordered sum of squares now reads its squares eight at a
time and adds them in the same order; quant_group computes a group's values once into registers and
writes out_bf16 itself; gated_quant_fp8 spreads a row's independent groups over ceil(groups/16)
work-groups. rad-kbench: 208/208 and 206/206 at rel_l2 0.

scripts/sycl/profile_decode.sh isolates decode steps' per-op device time (two profiled runs of the
same request, 1 and 1 + STEPS tokens, differenced). Decode at 1.8k context: 34.8 -> 26.6 ms of
device time a step; the two ops 9.1 -> 3.7 and 3.5 -> 0.9 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 20:47:13 +02:00
claudeandClaude Opus 5.5 b57c2db60c libxe2: split-KV attention -- a kv head's keys read once for its query heads, decode across the card
The long-context decode profile was 70% attention: one work-group a (row, head) left most of the
card idle at one row and read each kv head eight times. xe2_attn_paged now splits a row's keys into
partitions of 32 or more across work-groups, each work-group a (row, kv head, partition) whose
sub-groups are the kv head's query heads, the partial softmax states merged from 64 MiB of scratch
(the scratch hook); prefill-sized row counts take one partition and write directly.

rad-kbench 138/138 and 132/132, KL against libref mean 5.8e-4, p99 3.2e-3, top-1 98.5%. Decode
after a 1797-token prompt 16.2 -> 29.8 tok/s; short-context decode 32 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 20:42:38 +02:00
claudeandClaude Opus 5.5 96b3e1be83 libxe2: Phase 4 step 2 -- bf16 XMX GEMM for prefill and a one-pass paged attention
xe2_gemm_nt_xmx / xe2_logits_gemm_xmx (M >= 17, bf16): joint_matrix M8 N16 K16 with use::b loaded
column-major straight from the [N, K] weight, eight sub-groups a work-group on one 64-column slice
so a B tile is in cache for all of them; tail rows go to the GEMV and shapes the tiles cannot read
to the exact kernel. xe2_attn_paged: one pass with an online softmax, keys over eight sub-groups,
head_dim over lanes, libref's masks, windows, ragged batches and fp8 descales. Both keep their
exact twins under XE2_EXACT=1.

rad-kbench: fixture 499/499, MiniCPM5-2B 482/482 (worst rel_l2 1.7e-4). KL against the libref
reference over 1914 positions: mean 5.8e-4, p99 3.2e-3, top-1 98.7% -- inside the bound.
Prefill of a 1795-token prompt: 4.57 s, 393 tok/s (was ~17); decode 33.2 tok/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 20:34:02 +02:00
claudeandClaude Opus 5.5 a65ab54213 libxe2: Phase 4 step 1 -- a bandwidth-bound decode GEMV and an ordered sum from local memory
The profile of a MiniCPM5-2B decode step on the B65 (232.8 ms) was 79% gemm_nt, reading its
weights at 62 GB/s, and 13% the norms' serial sum of squares.

- xe2_gemm_nt_gemv / xe2_logits_gemm_gemv (priority 10, M <= 16, bf16): a sub-group an output
  column, 16-byte coalesced weight loads, a tree reduction. Not libref's order: rad-kbench passes
  them at the gemm tolerance (fixture 361/361, MiniCPM5 180/180, worst rel_l2 1.6e-4), and
  XE2_EXACT=1 sends every launch to the exact kernel for bisecting.
- The norms form their squares in parallel into local memory and add them in index order: still
  bit-identical to libref.

Decode 4.2 -> 35.5 tok/s. Against a libref-only host build, over 1914 positions of the repo's docs
with every position through the GEMV: KL mean 5.9e-4, p99 3.5e-3, top-1 98.5% -- libavx's own
distance from libref is 5.7e-4 / 3.0e-3 / 98.6%. The exact path scores KL 0, top-1 100%.

docs/SYCL_PROGRESS.md: the profile, the KL bound (D13), and the user's decision to use the bf16
container for Milestone B instead of the fp8 one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 19:48:40 +02:00
claudeandClaude Opus 5.5 5da5c1ba05 libxe2: the DSpark drafter's ops -- speculative decoding on the B65, greedy-identical
Every op MiniCPM5-2B bf16's DSpark drafter issues now has a libxe2 row, each libref's arithmetic in
libref's order: gemm_nt_q over fp8a8 block-scaled codes (quant_dot per output, the scale grids
worked out on the host as make_scales does), gemm_nt_q_gated with the gated fp8 epilogue, the w2a8
vocabulary head (gemm_zp; b_scale in libref's joined planes form through a copy of libref's layout
hook, so both libraries ask for the same stored bytes, its planes found on the device),
quant_act_i8, silu_mul, row_topk and dflash_select.

rad-kbench: MiniCPM5-2B 191/191 at rel_l2 0. The fixture found the gated GEMM refusing a 27B
geometry its row accepted (it held the whole N-wide row in local memory); it now keeps the n gated
values and declares N <= 57344. The engine oracle with speculation on: 1500/1500 issues
bit-identical, the w2a8 head included. Greedy with speculation on matches libref's greedy without
it on all eight prompts.

Install and oot: a SYCL build installs librad_sycl.so and libxe2.so, its executables find the
backend through $ORIGIN/../lib, and tests/oot_plugins.sh rebuilds libxe2 out of tree with icpx when
RAD_OOT_ICPX is set; it passes in build-sycl.

scripts/sycl/bench_report.sh: the report's screenshot is a JPEG, rendered with fonts (this host has
none, and the first post had no text). docs/SYCL_PROGRESS.md: the first quick benchmark (4.2 tok/s
decode, 17.3 tok/s prefill at 2000 tokens), Milestone B part 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 19:31:29 +02:00
claudeandClaude Opus 5.5 8db5b6efff libxe2: strided cast and libref's sigmoid -- MiniCPM5-2B serves on the B65, greedy-identical
Serving MiniCPM5-2B bf16 on the Arc Pro B65 found two things rad-kbench's dense operands did not:

- cast is handed the q slice of the fused qkv row (2048 of every 2560 elements) and refused it,
  stopping the first step by name. It now walks any strides in libref's offlin order.
- gated_quant_fp8 took sigmoid with an f32 exp, within rad-kbench's tolerance but not libref's
  double exp: now and then an ulp in silu moved the bf16 narrowing and one E4M3 code, in some of
  the 42 layers, enough to flip a greedy near-tie tokens later. The engine's own op oracle
  (RADIANCE_OP_ORACLE='*', which runs libref on the operands the device kernel was handed) found
  it: 9 of 600 issues before, 600 of 600 bit-identical after, over a 26-token prefill.

With both, a greedy run on the B65 matches a libref-only host server token for token on all eight
prompts of scripts/sycl/greedy_compare.py (64 tokens each), and the top-5 logprobs agree exactly
over 96 decode steps. /v1/chat/completions answers coherently, reasoning split out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 16:49:14 +02:00
claudeandClaude Opus 5.5 d0e797844e libxe2: the thirteen sampler ops
Each is libref's arithmetic on the card. The serial stages (penalties, DRY, the n-gram ban, top-p,
min-p, typical, XTC, the pick) run libref's loops unchanged, one work-item a row, so their sums keep
libref's order. Temperature and the grammar mask are one work-item an element. argmax, top-k and
logprobs scan the vocabulary with one work-group a row, reducing a 64-bit key -- the value's
order-preserving bits above the complemented index -- so the largest value wins and ties go to the
lower id, libref's rule; top-k is libref's topk_next k times, and a greedy row takes no rounds.
DRY's per-token map is replaced by a first-occurrence scan that computes the same maxima.

rad-kbench against libref: the whole fixture with libxe2 first, 1101/1101; MiniCPM5-2B's sampler
cases 56/56, all at rel_l2 0. With this, every op MiniCPM5-2B bf16 issues with speculation off has
a device row in libxe2 (13 model ops, 13 sampler ops).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 16:21:22 +02:00
claudeandClaude Opus 5.5 ed76fc8aaa libxe2: kv_store and attn_paged, correctness first
The paged cache in libref's and libr4d's layout. attn_paged runs one work-group a (query row, head)
in libref's order: each key's dot summed over d serially by its lane, the max over the group, then
weights by chunk in local memory with the sum and every acc[d] accumulated in key order, exp in
double. Scores are recomputed rather than kept, since 131072 keys of them do not fit local memory.
Masks, sliding windows, ragged batches and fp8 descales are libref's. kv_store skips a slot past
the cache instead of refusing the launch, which would need the host to read device memory.

rad-kbench against libref: fixture 178/178, MiniCPM5-2B 160/160 (rel_l2 0).

docs/SYCL_PROGRESS.md: the HIP build compiles (785/785 targets for gfx1201 in the ROCm 10.1
container) at the commit holding every core-side change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 16:12:32 +02:00