libxe2, arch/common: the 28 Oct pending set, the bf16 cast fused, the vectorized norm, a draft-vocab prefix

- 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>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-11-02 01:52:01 +01:00
1 parent 7580ec3d17
commit 726e532114
18 files changed
+472 -54

No files matched your search

+12
View File
@@ -143,6 +143,9 @@ int gdn_chunk_scan_dpas(sycl::queue& q, const uint16_t* qp, int64_t qs0, int64_t
int64_t bs1, uint16_t* op, int64_t os0, int64_t os1, const float* h0, const int64_t* h0s,
float* ht, const int64_t* hts, const RadTensor* cu, const char* si, uint32_t sidt, int64_t sw,
int64_t T, int64_t N, int64_t H, int64_t Hg, float scale);
int gdn_kkt_solve_dpas(sycl::queue& q, const uint16_t* kp, int64_t ks0, int64_t ks1, const float* g, int64_t gs0,
int64_t gs1, const float* beta, int64_t bs0, int64_t bs1, uint16_t* Ap, int64_t As0,
int64_t As1, const RadTensor* cu, int64_t T, int64_t N, int64_t H, int64_t Hg);
/* ------------------------------------------------------------------ gdn_conv_prep */
int gdn_conv_prep(const RadArgs* a, RadStream st) {
@@ -478,6 +481,15 @@ int gdn_kkt_solve(const RadArgs* a, RadStream st) {
const IV cuv = iv_of(cu);
sycl::queue* qu = queue_of(st);
if (!qu) return RAD_E_DEVICE;
/* The DPAS form (xe2_gdn_esimd.cpp) for the engine's operands: tolerance-held, so not under
* XE2_EXACT=1; it refuses a layout its 2D loads cannot take, and the exact kernels run. */
if (K == 128 && chunk == 64 && !exact_only() && !std::getenv("XE2_KKT_SERIAL") && ks.dt == RAD_BF16 &&
bs.dt == RAD_F32 && gs.dt == RAD_F32 && As.dt == RAD_BF16 && kv.s2 == 1 && Av.s2 == 1) {
const int rc = gdn_kkt_solve_dpas(*qu, (const uint16_t*)ks.p, kv.s0, kv.s1, (const float*)gs.p, gv.s0, gv.s1,
(const float*)bs.p, bv.s0, bv.s1, (uint16_t*)As.p, Av.s0, Av.s1, cu, T, N,
H, Hg);
if (rc != RAD_E_UNSUPPORTED) return rc;
}
if (chunk == 64 && K <= 128 && !std::getenv("XE2_KKT_SERIAL")) {
/* A work-group a (sequence, v head, chunk): chunks are independent here. The chunk's k rows
* (bf16, exact) in local memory; first every row term beta_i (k_i . k_j) e^{g_i - g_j},