libxe2: the norm and the fp8 quantisers 3-4x faster at decode, still bit-identical to libref

At one row a work-group, rmsnorm_quant_fp8 took 108 us and gated_quant_fp8 84 us a call (26% and 10%
of a decode step at a 1.8k context). The ordered sum of squares now reads its squares eight at a
time and adds them in the same order; quant_group computes a group's values once into registers and
writes out_bf16 itself; gated_quant_fp8 spreads a row's independent groups over ceil(groups/16)
work-groups. rad-kbench: 208/208 and 206/206 at rel_l2 0.

scripts/sycl/profile_decode.sh isolates decode steps' per-op device time (two profiled runs of the
same request, 1 and 1 + STEPS tokens, differenced). Decode at 1.8k context: 34.8 -> 26.6 ms of
device time a step; the two ops 9.1 -> 3.7 and 3.5 -> 0.9 ms.

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 20:47:13 +02:00
1 parent 880c218375
commit f5614a03bb
3 files changed
+131 -31

No files matched your search

+15
View File
@@ -412,6 +412,21 @@ sub-group walking every key for its head): 32 keys fixed it.
- **Decode after a 1797-token prompt: 16.2 -> 29.8 tok/s**; short-context decode 32.0 tok/s;
1797-token prefill 4.61 s.
## Phase 4, step 4 (2026-10-23): the norm and the quantisers, still exact
`scripts/sycl/profile_decode.sh MODEL PROMPT [STEPS] [flags]` isolates decode: the same request at
1 and 1 + STEPS tokens in two profiled servers, the difference per op divided by STEPS. At a
1.8k-token context, before: 34.8 ms/step of device time -- gemm_nt 9.65, attn_paged 9.51,
rmsnorm_quant_fp8 9.12 (108 us a call for one row), gated_quant_fp8 3.52 (84 us, one work-group a row
and every value computed twice, a double exp each).
- The ordered sum reads its squares eight at a time, adding them in the same order.
- `quant_group` computes a group's values once into registers (up to 128 a group) and writes
out_bf16 itself; `gated_quant_fp8` spreads a row's groups over ceil(groups/16) work-groups.
- Still bit-identical: rad-kbench 208/208 and 206/206 at rel_l2 0.
- After: **26.6 ms/step** -- gemm_nt 9.62, attn_paged 9.50, rmsnorm_quant_fp8 3.75, logits_gemm 1.02,
gated_quant_fp8 0.87.
## Next steps
1. ~~Milestone B, part 2: `minicpm5-2b-fp8.rad`~~ **Dropped by the user (2026-10-23): "instead of the