Where N % 16 == 0 and K % 512 == 0 the meta bytes (in the codes blob) and the E8M0 plane (b_scale,
tag "xe2.m2.e8m0.t16") are stored in chunks of a tile's 16 groups, [dword][lane], so the ESIMD
kernel reads four steps of them with one block load each instead of gathers across 16 rows. The
exponent plane's stored form appends each column's largest exponent (int32), computed once at
load, so the prepass no longer scans the plane on every call; unrelayout drops it and untiles the
exponents exactly. Every m2 reader reads the tiled forms.
rad-kbench against libref: 70 checked, 70 passed (worst rel_l2 1.2e-3). M = 8: gate_up 222 -> 205,
down 119 -> 113 us; prefill shapes flat to -5%. Greedy output identical; 512-token decode 33.3 ->
33.9 tok/s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
Where N % 16 == 0 and K % 128 == 0 the layout hook asks for "xe2.m2.tiled16": a 16-column tile's
128-column step is 1 KiB, dword w of its columns side by side, the ESIMD kernel's [word][lane]
registers as they lie (four block loads in place of four d32x4 gathers). M = 1 goes to the same
kernel when tiled. Every m2 reader in libxe2 (exact, SIMT GEMV, jm and SIMT DPAS forms, prefill
decode) reads the tiled form; unrelayout inverts it for the oracle.
rad-kbench against libref: 70 checked, 70 passed (worst rel_l2 1.2e-3). M = 8: gate_up 240 -> 222,
down 140 -> 119, N=1024 50 -> 25 us. Greedy output identical (8 prompts x 64 tokens); 512-token
decode 31.8 -> 33.3 tok/s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
Kernels, each libref's arithmetic in libref's order:
- gemm_nt_q at m2xfp4 (xe2_gemm_m2.cpp) with libref's m2 layout hooks, and givens_dense_quant
(xe2_givens.cpp, the rotation in double as libref's)
- the gated delta net (xe2_gdn.cpp): gdn_conv_prep, gdn_conv_update, gdn_kkt_solve, gdn_chunk_scan,
gdn_recurrent_update (per-candidate and anchor state forms), gdn_gated_rmsnorm,
gdn_conv_recurrent_update; each work-item one iteration of libref's parallel loop, the
per-(sequence, head) workspaces in a shared device workspace (xe2_common: workspace())
- rope's multi-component modes (mrope, imrope, axial) and rope_table
- logits_gemm over an fp8 128x128 joined head, gemm_nt_bias with its epilogue
- mul, sigmoid, scatter_rows, layernorm, grid_embed, attn_dense (the vision tower)
- dflash_conv and logit_rerank (plain and joined head) for the DFlash2 drafter
libref's gemm_m2 gains the parts (pb1/pb2) every other ParoQuant grid and libr4d's mx_parts
already define -- weight rows [0, e1), [e1, e2), [e2, N) read activation copies 0, 1, 2 side by
side -- since this model's fused projections are rotated per piece and the oracle declined them;
its shape hook widens a and a_scale by the part count. Both m2 arms now take the stored
codes-then-meta blob as the engine describes it, u8 [N, K], beside the shape hook's rank-1 form
(libref refused the engine's launch; only libr4d had been run on it).
rad-kbench on the fixture: every new row at rel_l2 0 (90 gdn/givens cases, 108 rope, 80
elementwise, 20 attn_dense, the drafter's and the heads'). On the B65 the model starts with every
op on the card and answers "The capital of France is" -> " Paris.\nThe capital of Germany is
Berlin.\nThe capital of Italy is" (greedy), at 0.1 tok/s: the correctness-first kernels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1