+| 2026-07-04 `bc0a8d7` (GB10 FREE-BOX, tensor-core NVFP4 W4A16 GEMM) | **M2.7: move the prefill-dominant fp4 W4A16 GEMMs onto Blackwell tensor cores** (`nvcuda::wmma` m16n16k16 bf16×bf16→f32, dequant-into-shared-bf16 — dequant stays CUDA-core, MMA on tensor cores). Dense `MatmulNvfp4Wmma` (64×64 tile, BK=32, 2×2 warps, col-major B-load = no transpose). Grouped `MoeGroupedGemmNvfp4Wmma` (the 70% lever): added **device-side expert grouping** (counting sort: histogram/prefix/atomic-scatter into pair-row + source-act-row, ragged per-BM-tile expert map, tail-masked) → dense bf16 WMMA GEMM per expert, buying BOTH weight-reuse AND tensor cores. Self-contained in the op (identical signature, no engine/model changes); large-P prefill only (small-P decode keeps the naive kernel byte-for-byte); `VT_NVFP4_WMMA=0` toggle for same-binary A/B. Mirrors killgate 0035 (Marlin grouped) shape, adapted to modelopt layout + added the expert-grouping (0035's input was pre-sorted). | unit `test_ops_nvfp4_matmul` 4/4 (37/37 assert: single-tile, multi-tile P/E>BM ragged, odd N/K tails, WMMA==per-expert dequant-matmul ref); paged gate **16/16 token-for-token**; CPU 82/82; -Werror clean rebuild green | **VALIDATED + FREE-BOX MEASURED vs vLLM (0% contention, same-binary A/B).** Prefill TTFT **14.40→6.10s (2.36×)**; 8×1024×128 total **70.16→157.27 tok/s (2.24×)**, output 7.79→17.47, batched TTFT **100.06→32.76s (3.05×)**. **vLLM oracle (8×1024×128 enforce-eager, same box) = 1181.78 total / 131.31 output → total gap CLOSED 16.8×→7.5×.** nsys: fp4 MoE GEMM **70.7%→11.6%** of prefill (now wmma); **bottleneck MOVED to `GdnScanKernel` 63.8%** (the recurrence — next lever, out of scope here). HONEST: kernel ~3–4 TFLOP/s useful (below bf16 peak — small N=512 MoE tiles, ragged BM waste ~32 rows/expert, CUDA-core dequant); the 2.36× is driven as much by expert-grouping (weight reuse) as tensor cores. Native-fp4-MMA stretch NOT attempted (killgate 0034/0035: W4A4 FP4-MMA regressed on GB10 — low marginal leverage now GDN dominates). Tuning headroom: larger tiles, cp.async pipeline, drop BM waste. |
0 commit comments