From 2675dba42ca24c3bc03571645e08904e0640e130 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 26 Oct 2026 03:53:16 +0100 Subject: [PATCH] docs: the w2a8 head on 2-bit DPAS, BetterBench 53.2 tok/s Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1 --- docs/SYCL_PROGRESS.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/SYCL_PROGRESS.md b/docs/SYCL_PROGRESS.md index 8303d7f4..5b66e78b 100644 --- a/docs/SYCL_PROGRESS.md +++ b/docs/SYCL_PROGRESS.md @@ -12,7 +12,7 @@ from it alone. | 1 codebase study, `SYCL_PORTING.md` | done (`docs/SYCL_PORTING.md` §1-§3, Appendix A) | | 2 design | done: device backend, build integration, core kernels (`device_test_sycl` on the B65) | | 3 correctness-first kernels | **Milestone A reached 2026-10-23** (`874f8d2`): MiniCPM5-2B bf16 serves on the B65, greedy-identical to the libref host backend; Milestone B next | -| 4 performance | MiniCPM5-2B bf16: decode 4.2 -> 51.8 tok/s, prefill 17 -> 1576 tok/s (`b07da2a`); Qwen3.8-27B-PARO-M2XFP4 (the model from 2026-10-23): 0.1 -> 52.0 tok/s decode on BetterBench with the DFlash2 drafter (`68d510b`), prefill 356 tok/s at 2000 tokens (vLLM-SYCL's reference ~90 / ~1200), in progress | +| 4 performance | MiniCPM5-2B bf16: decode 4.2 -> 51.8 tok/s, prefill 17 -> 1576 tok/s (`b07da2a`); Qwen3.8-27B-PARO-M2XFP4 (the model from 2026-10-23): 0.1 -> 53.2 tok/s decode on BetterBench with the DFlash2 drafter (`2a5e815`), prefill 356 tok/s at 2000 tokens (vLLM-SYCL's reference ~90 / ~1200), in progress | | 5 broaden and finish | not started | ## Open blockers / questions for the user @@ -165,6 +165,7 @@ fonts (this host has none; the first post had no text) -- all unpacked without r | 2026-10-25 | `ef6c6e1` | qwen38-27b-m2xfp4 | sycl, verify GEMM in ESIMD, gdn load order | `--max-model-len 8192 --max-num-seqs 1 --embedding-placement vram` | 356.4 / 355.6 @2000 | 44.4 / - | decode +19.8%, prefill +4.5% | `~/radiance-bench/runs/20261025-111356-qwen38-27b-m2xfp4-ef6c6e1/results.html`, posted with `report.jpg` | | 2026-10-25 | `340231d` | qwen38-27b-m2xfp4 | sycl, + e_max in the prepass, range-copy staging, w2a8 head staging, 16-byte exponent gathers | same | 356.3 / 355.4 @2000 | 48.2 / - | decode +8.7% | `~/radiance-bench/runs/20261025-142422-qwen38-27b-m2xfp4-340231d/results.html`, posted with `report.jpg` | | 2026-10-26 | `68d510b` | qwen38-27b-m2xfp4 | sycl, + m2xfp4 codes tiled at load | same | 356.0 / 354.8 @2000 | 52.0 / - | decode +7.9% | `~/radiance-bench/runs/20261026-014745-qwen38-27b-m2xfp4-68d510b/results.html`, posted with `report.jpg` | +| 2026-10-26 | `2a5e815` | qwen38-27b-m2xfp4 | sycl, + meta/exponents tiled with stored e_max, quant_act_fp8 per group, the w2a8 head on u2 DPAS | same | 355.3 / 354.6 @2000 | 53.2 / - | decode +2.2% | `~/radiance-bench/runs/20261026-034439-qwen38-27b-m2xfp4-2a5e815/results.html`, posted with `report.jpg` | | 2026-10-23 | `b07da2a` | minicpm5-2b-bf16 | sycl, Phase 4 steps 2-6 (XMX prefill, split-KV attention, norms, GEMV split) | same | 1575.6 / 1547.1 @2000 | 51.8 / 41.4 | decode +104.7%, prefill 90x | `~/radiance-bench/runs/20261023-221354-minicpm5-2b-bf16-b07da2a/results.html`, posted with `report.jpg` | ## Models @@ -827,6 +828,29 @@ The round (story prompt, unitrace -d): 84.4 -> 77.3 ms of device time; the verif ~5 us a group of dependent loads, reduction and stores (49.6 us at n = 17408 whatever M). A sub-group a (row, group) instead, as gated_quant_fp8 already did: 8.0 us, rel_l2 0 against libref. +**The w2a8 draft head on 2-bit DPAS** (`34ae231`, `2a5e815`). This card's int8 DPAS takes u2 B +operands against s8 A, 16 codes a dword from the low end (probe dpas_u2.cpp; the 8-bit layout's +"4 codes in a byte" packing gives wrong sums). So the DFlash2 drafter's head (248320 x 5120 u2, +group 128, f16 scale, u8 zero) needs no decode: gemm_zp_layout stores its codes tiled +("xe2.zp.u2.t16", a 16-column tile's 32-column step 128 bytes [dword][lane], each dword the +column's codes at quant_act_i8's stored positions, so the activation's step order is folded into +the layout), and an ESIMD kernel (xe2_gemm_zp_esimd.cpp) feeds them to DPAS as they lie, the +activation staged once a work-group in local memory as the A operand. Each group's integer sum is +exact and the group terms are added in order, as zp_dpas and libref do. Checked on 20 calls of the +engine's own inputs against the SIMT GEMV on the same bytes, 0 of 1738240 outputs differ each +(rad-kbench has no w2a8 recipe on this container), greedy output identical. + +| form | ms a call | +|---|---| +| zp_dpas (SIMT, per-lane 8-byte code loads, B decoded) | 2.56 | +| ESIMD, 16 threads a work-group | 1.66 | +| 32 threads (the 40 KB staging shared by more columns) | 0.96 | +| 32, a group's codes one 512-byte load | 0.77 | +| **64, a group's codes one 512-byte load** | **0.74** | + +BetterBench at `2a5e815` (exponent tiling, quant_act_fp8, the draft head on top of `68d510b`): +decode 52.0 -> 53.2 tok/s. + **Probes, kept out:** - *512-byte block loads* of the activation (four in place of eight 256-byte ones a step): no change (246 vs 246 us). The activation loads are not what the send stalls are made of. @@ -868,8 +892,8 @@ the link (4 ms a round). ~45 ms together, most of them latency- or message-bound rather than byte-bound: run each through `unitrace --stall-sampling` (rad-kbench or a probe) before changing it -- this session's guesses without it mostly measured nothing. givens (21 us for ~3 MB, 290 calls), the gdn phases (39 / 63 - us against ~11 / ~6 us of state traffic), attention, the draft head (2.56 ms for ~0.35 GB of - 2-bit codes), the fp8 logits head (3.5 ms, floor ~2.3). givens and the gdn ops have no rad-kbench + us against ~11 / ~6 us of state traffic), attention, the fp8 logits head (3.5 ms, floor ~2.3: an + ESIMD form like the m2 kernel's, ~0.7 ms at best; no fp8 DPAS on this card). givens and the gdn ops have no rad-kbench recipe on this container and the server's stall samples come back empty, so each needs a standalone probe first. 2. Prefill (349 tok/s at ~1900 tokens; ~5.6 s): the GEMMs 1.67 s (oneMKL ~1.2 of it; the m2xfp4