Archived
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
This commit is contained in:
1 parent
b0e34c6324
commit
b605debcdb
2 files changed
+121
-1
No files matched your search
+47
-1
@@ -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 -> 13.2 tok/s decode, 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 -> 30.6 tok/s decode with the DFlash2 drafter, prefill 124 tok/s (`b0e34c6`), in progress |
|
||||
| 5 broaden and finish | not started |
|
||||
|
||||
## Open blockers / questions for the user
|
||||
@@ -160,6 +160,7 @@ fonts (this host has none; the first post had no text) -- all unpacked without r
|
||||
| 2026-10-23 | `874f8d2` | minicpm5-2b-bf16 | sycl, correctness-first kernels | `--num-speculative-tokens 0 --max-model-len 8192 --max-num-seqs 4` | 17.3 / 17.3 @2000 (8000+ skipped: over the 8192 context) | 4.2 / 3.5 | first run | `~/radiance-bench/runs/20261023-165102-minicpm5-2b-bf16-874f8d2/results.html`, posted with `report.jpg` |
|
||||
| 2026-10-23 | `a869226` | minicpm5-2b-bf16 | sycl, Phase 4 step 1 (GEMV) | same | 17.5 / 17.4 @2000 | 25.3 / 16.2 | decode +504.5% | `~/radiance-bench/runs/20261023-194856-minicpm5-2b-bf16-a869226/results.html`, posted with `report.jpg` |
|
||||
| 2026-10-24 | `5720a95` | qwen38-27b-m2xfp4 (Qwen3.8-27B-DFLASH2-PARO-M2XFP4) | sycl, fast m2xfp4 GEMV / DPAS verify / tiled XMX prefill, DFlash2 drafter on | `--max-model-len 8192 --max-num-seqs 4` | 113.4 / 113.3 @2000 | 19.1 / - | first run | `~/radiance-bench/runs/20261024-060226-qwen38-27b-m2xfp4-5720a95/results.html`, posted with `report.jpg` |
|
||||
| 2026-10-24 | `b0e34c6` | qwen38-27b-m2xfp4 | sycl, the speculative round's kernels (draft head and logits on DPAS, exact selection ops, typed gdn, vector norm, register-DPAS verify GEMM) | `--max-model-len 8192 --max-num-seqs 1` | 131.3 / 130.6 @2000 | 28.9 / - | decode +51.5%, prefill +15.8% | `~/radiance-bench/runs/20261024-135808-qwen38-27b-m2xfp4-b0e34c6/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
|
||||
@@ -572,8 +573,53 @@ Probes in the scratch directory, not in the tree: `gemm.cpp` (XMX GEMM tilings),
|
||||
m2xfp4 data), `chain.cpp` (the ordered-sum floor), `jmap.cpp` (joint_matrix_apply coordinates on a
|
||||
packed B -- lost the device; not used).
|
||||
|
||||
## Qwen3.8-27B: the speculative round (2026-10-24)
|
||||
|
||||
**What the target means.** The user's vLLM numbers (~90 tok/s decode, ~1200 tok/s prefill) are for
|
||||
`Swift-1.5-Qwen3.8-27b-GPTQ-Int4-baked-v1-embed-int8` with MTP6 speculation: its model card's own
|
||||
records (`benchmarks/swift-baked-coding-c1.jsonl`) show ~5.3 tokens a round at ~68 ms a round. One
|
||||
token at a time is bandwidth-bound near 40 tok/s on this card, so the lever is the cost of a round,
|
||||
not acceptance: radiance's DFlash2 drafter already lands 4.2-4.3 tokens a round (45-47% of drafts
|
||||
accepted, `/metrics` `radiance:draft_*`), but a round cost ~235 ms.
|
||||
|
||||
**Per round, device time** (`scripts/sycl/profile_decode.sh`, 256 tokens, grouped by geometry):
|
||||
|
||||
| op | before | after | how |
|
||||
|---|---|---|---|
|
||||
| w2a8 draft head (N=248320) | 24.0 ms | 4.2 | int8 DPAS on the group sums, u2 codes unpacked into the packed B tile; lane-per-column group terms in order: bit-identical (63/63 live calls against the libref-checked form) |
|
||||
| dflash_select | 11.4 | 0.5 | a sub-group a sequence, a lane a candidate in libref's order: exact |
|
||||
| row_topk (R=32 of 248320) | 3.2 | 0.95 | 128 chunks' top R, then the top R of the winners: exact |
|
||||
| logits head, M = 8 | 9.5 | 3.5 | E4M3 by bits into a packed fp16 tile, fp16 DPAS, a scale block's sum scaled in f32 (also M = 1: 3.9 -> 3.4) |
|
||||
| gemm_nt bf16, N=96 x 48 | 7.7 | 1.4 | M <= 8 on bf16 DPAS, 8 activation rows in local memory, K split |
|
||||
| rmsnorm_quant_fp8 x 128 | 17.2 | 6.5 | 16-byte loads and stores for bf16 rows (gain bf16 or f32): 112 -> 44 us a call, bit-identical (408/408 live) |
|
||||
| gdn_conv_recurrent_update x 48 | 32.7 | ~13 | typed q/k/v and an f32 state moved 16 rows at a time through local memory: the 8-token pass 408 -> 101 us, the replay 222 -> 110 us; bit-identical (400/400 live) |
|
||||
| m2xfp4 verify GEMMs | ~86 | ~75 | DPAS on registers (`dpas_f16`, SPV_INTEL_subgroup_matrix_multiply_accumulate): a lane decodes its column straight into B, no local memory; 15-20% a call |
|
||||
|
||||
**End to end** (greedy, 512-token answers, drafter on): **30.4-30.9 tok/s** (was 14.0); prefill 124
|
||||
tok/s at 2584 tokens (unchanged).
|
||||
|
||||
**Learned on the way.**
|
||||
- libxe2's generic element accessors (`rad_load_f32` / `DT::ld`, a dtype switch an element) inside
|
||||
a kernel's hot loop cost far more than their instruction count: the gdn register kernel ran 8x a
|
||||
probe of the same loop until its accessors were typed. Kernels that stream with them are suspects.
|
||||
- The m2 verify GEMM's weight stream is not the limit by layout: the lane-a-row 64-byte pattern
|
||||
reads 89 MB of codes at 526 GB/s alone (a contiguous 1 KiB-a-sub-group layout: 281 GB/s, probe
|
||||
`pat.cpp`); the kernel loses its time on the activation loads and the decode not overlapping it.
|
||||
Tried and slower: two column tiles a lane (463 -> 639 us), the step's activation loads batched
|
||||
ahead (-> 586 us), longer per-lane runs (KS 8/16), more K splits, a software-pipelined line load.
|
||||
- VTune's GPU analyses do not run here (it does not recognise the host CPU); the per-kernel split
|
||||
above came from temporary waits around each sub-kernel.
|
||||
|
||||
## Next steps
|
||||
|
||||
1. The verify round, ~137 ms now against vLLM's ~68: the m2xfp4 verify GEMMs (~75 ms, ~2.5x their
|
||||
bandwidth floor), givens_dense_quant at M = 8 (~19 ms), the DeltaNet conv (~70 us x 48) and its
|
||||
norm kernel, embed_lookup over the x1 link (4 ms: the table is host-pinned), attention.
|
||||
2. Prefill (124 tok/s): the chunk scan (4.6 s of 1792 tokens; its probe runs 3x faster than the
|
||||
engine's kernel), the prefill GEMM (~30% of the DPAS peak), kkt.
|
||||
|
||||
## Next steps (Milestone era)
|
||||
|
||||
1. ~~Milestone B, part 2: `minicpm5-2b-fp8.rad`~~ **Dropped by the user (2026-10-23): "instead of the
|
||||
fp8 use the one you are already using so the bf16".** Milestone B's MiniCPM5 half is the bf16
|
||||
container with its DSpark drafter, done above.
|
||||
|
||||
Reference in new issue
Block a user