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
This commit is contained in:
pascallinxweilerandClaude Opus 5.5 committed 2026-10-23 19:31:29 +02:00
1 parent 874f8d28b1
commit 43d84111c2
13 files changed
+1076 -36

No files matched your search

-18
View File
@@ -82,24 +82,6 @@ inline bool hist_window(const RadSampleParams& sp, int32_t last_n, int64_t hmax,
inline float ref_exp(float x) { return (float)sycl::exp((double)x); }
inline float ref_log(float x) { return (float)sycl::log((double)x); }
/* The selection key: larger value first, then lower index. 0 is no candidate (NaN). */
inline uint64_t sel_key(float v, int64_t i) {
if (sycl::isnan(v)) return 0;
if (v == 0.0f) v = 0.0f;
uint32_t b;
std::memcpy(&b, &v, 4);
const uint32_t ord = (b & 0x80000000u) ? ~b : (b | 0x80000000u);
return ((uint64_t)ord << 32) | (uint64_t)(~(uint32_t)i);
}
inline int64_t key_index(uint64_t k) { return (int64_t)(~(uint32_t)k); }
inline float key_value(uint64_t k) {
const uint32_t ord = (uint32_t)(k >> 32);
const uint32_t b = (ord & 0x80000000u) ? (ord & 0x7fffffffu) : ~ord;
float v;
std::memcpy(&v, &b, 4);
return v;
}
/* A candidate plane row: cand_idx (integer) and cand_val (float), rows of n_cand. */
struct Cands {
Rows idx, val;