Archived
gemm_nt_bias (Y = A B^T + bias, then gelu / gelu_tanh and a residual) had only the correctness-first row: one work-item an output over ascending k. 22 architectures use it (the ViT, SigLIP2, GLM-vision, SAM and Gemma4-audio blocks, Qwen3-ASR, nomic-bert, the diffusion VAEs and UNets). The new row forms A B^T on the existing bf16 kernels (the skinny GEMV at M <= 16, XMX above; each falls back to the exact kernel where its layout is refused) into an f32 workspace, and gemm_plain runs only its epilogue on it, so the bias, activation, residual and their roundings are the reference row's. XE2_EXACT=1 keeps the ref row. rad-kbench: fixture 210/210 (worst rel_l2 1.7e-4), full fixture 2144/2144; the Qwen3.5-9B vision tower's shapes all agree with libref. N = K = 4608 + gelu on the B65: M = 1 1,627 -> 81 us, M = 16 8,221 -> 104, M = 128 74,573 -> 253, M = 512 302,924 -> 721. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>