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
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
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
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
libxe2 is a kernel plugin like any other, built by rad_add_plugin from the icpx sub-build into the
build tree's $RADIANCE_HOME. It declares no schemas (every op it serves is libref's vocabulary), only
device rows, written with designated initialisers. xe2_common.h holds what every kernel needs: the
launch's queue (rad_sycl.h), row views over padded operands, refusals that name the geometry, and
libref's own dtype conversions so results round where the reference's do.
add passes rad-kbench against libref at tolerance zero, on the recorded fixture (30 cases) and on
MiniCPM5-2B's container (20 cases), inside guarded allocations. In a SYCL build the kbench replays
run libxe2 on the card, so they are labelled sycl there, as they are gpu in a HIP build.
scripts/sycl/notify.sh posts to the Discord webhook when the port needs the user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
A fourth DeviceBackend, in librad_sycl.so: in-order sycl::queues on one context, events as
barriers, copies and fills on the queue, gates as a spin kernel on a pinned flag, and the core's
advance and weight-table kernels as SYCL twins of their .hip files. RadStreams are RadSyclStreams
(abi/rad_sycl.h). Pinned host memory is page-aligned memory registered for device copies, since
O_DIRECT cannot read into SYCL's malloc_host pages; event timing is opt-in (RADIANCE_SYCL_TIMING=1)
because profiling queues cost ~20 us of host time a submission.
The SYCL code is its own CMake project, sycl/, configured with icpx through ExternalProject, so the
engine and every host plugin stay on the main compiler: a SYCL build's host code is the default
build's. RAD_SYCL (default OFF), build.sh --sycl, the sycl presets; HIP and SYCL in one build are
refused at configure.
On the SYCL backend --tp > 1 and ops resolved only to host kernels stop the start, since the Intel
backend runs on one card and never puts an op on the CPU. A SYCL build that sees no GPU warns that
it runs on the CPU and names the missing oneAPI environment.
device_test runs on the Arc Pro B65 as device_test_sycl (label sycl): 36 cases pass, 12 skip
(elastic memory, not provided; host-backend-only cases). Host tests hide Level Zero GPUs with
ONEAPI_DEVICE_SELECTOR. The host tier is the baseline's in both the default and the SYCL build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
A SYCL kernel library has no hipLaunchKernel for the engine to serve, so under the SYCL backend a
RadStream points to a RadSyclStream: a magic, its own version, and the engine's in-order
sycl::queue. rad_sycl_queue() hands a plugin the queue or null for any other stream. The struct is
versioned by RAD_SYCL_STREAM_VERSION rather than RAD_ABI_VERSION, since no shape an existing plugin
compiles against changes; rad_abi.h and rad_types.h say so.
The layout tests cover it: strict C11 in abi_c_test.c, and its rows in abi_layout_rows.h, where a
struct the frozen table predates is allowed without a version bump.
docs/SYCL_PROGRESS.md: D6 revised. Building everything with icpx fails in libavx (_pdep_u64 without
-mbmi2, which GCC accepts and clang refuses), so the main build stays GCC and only SYCL code is
built by icpx, as shared libraries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
The core's HIP use is already behind the DeviceBackend vtable except three core kernels (advance,
wtab, xprefetch), the engine's interposed hipLaunchKernel that plugins launch through, and build
switches; each site is listed with file and line. The minimal set for MiniCPM5-2B is measured with
--debug-graph on the test suite's synthetic llama containers (13 model ops, 13 sampler ops; fp8 adds
gemm_nt_q / gemm_nt_q_gated), since no MiniCPM5 container is in the model library.
The design: a fourth DeviceBackend over SYCL, a RadSyclStream hand-off for plugins with its own
version instead of an ABI bump, libxe2 AOT for bmg-g31, and on that backend a fatal error where the
planner would otherwise put a weighted op on the CPU.
scripts/sycl/op_inventory.sh generates the 238-op appendix: libref's schemas through rad-schemas,
libr4d's 407 rows parsed from source by r4d_rows.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
scripts/sycl/probe.sh builds and runs two probes on the Arc Pro B65 (Level Zero, xe driver): the
device's limits and joint_matrix combinations, and an ESIMD DPAS check of E4M3 / E5M2 against bf16
and s8 controls in the same harness. bf16, fp16, s8 and tf32 XMX are exact; fp8 DPAS compiles for
bmg-g31 but returns garbage, so fp8 weights are widened to bf16 in-register (exact for E4M3).
docs/SYCL_PROGRESS.md is the resume log: device tables, the host baseline (82/88 of -LE 'gpu|oot';
the six failures are FFmpeg-less builds and CPU-time budgets on this VM), BetterBench setup, the
model library survey and the open blockers (no MiniCPM5 container in the library, no ROCm here).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1