Commit Graph
2 Commits
Author SHA1 Message Date
pascallinxweilerandClaude Opus 5.5 874f8d28b1 libxe2: strided cast and libref's sigmoid -- MiniCPM5-2B serves on the B65, greedy-identical
Serving MiniCPM5-2B bf16 on the Arc Pro B65 found two things rad-kbench's dense operands did not:

- cast is handed the q slice of the fused qkv row (2048 of every 2560 elements) and refused it,
  stopping the first step by name. It now walks any strides in libref's offlin order.
- gated_quant_fp8 took sigmoid with an f32 exp, within rad-kbench's tolerance but not libref's
  double exp: now and then an ulp in silu moved the bf16 narrowing and one E4M3 code, in some of
  the 42 layers, enough to flip a greedy near-tie tokens later. The engine's own op oracle
  (RADIANCE_OP_ORACLE='*', which runs libref on the operands the device kernel was handed) found
  it: 9 of 600 issues before, 600 of 600 bit-identical after, over a 26-token prefill.

With both, a greedy run on the B65 matches a libref-only host server token for token on all eight
prompts of scripts/sycl/greedy_compare.py (64 tokens each), and the top-5 logprobs agree exactly
over 96 decode steps. /v1/chat/completions answers coherently, reasoning split out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 16:49:14 +02:00
pascallinxweilerandClaude Opus 5.5 b2cdcb4420 libxe2: rmsnorm, rmsnorm_quant_fp8, quant_act_fp8, gated_quant_fp8
One work-group a row; a quantisation group a sub-group. The arithmetic is libref's step for step,
and two things made it so on the card:

- Device code is generated at link time (AOT), so the flags that shape it now go to the link as
  well as the compile: -ffp-contract=off, -ffp-model=precise, and -foffload-fp32-prec-div/-sqrt.
  Without correctly rounded division a group's scale amax * (1/448) came out one ulp off, and
  bf16 inputs sit exactly on E4M3 rounding ties often enough that 1780 of 524288 codes moved
  (a standalone host/device comparison showed it; with the flags, none).
- The sum of squares is libref's ascending f32 sum, by one work-item. A tree reduction moved
  normed values across bf16 ties on MiniCPM5-2B's real weights and failed rmsnorm_quant_fp8 at
  M=1 (rel 7.7e-3 against its 4e-3 tolerance).

rad-kbench against libref: the fixture 228/228 and MiniCPM5-2B's container 140/140, worst rel_l2
1e-7, inside guarded allocations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 16:02:58 +02:00