From 4 to 285 TFLOP/s: Part 1 of writing speed-of-light GEMM kernels on Blackwell B200
HanGuo97 · x · 2026-09-05
Luke D. Huang published part 1 of a blog series: writing a sequence of progressively optimized BF16 GEMM kernels in CuTeDSL on B200, ultimately reaching 99% of cuBLAS performance on several matrix dimensions. This 19-minute post covers:
- Kernel 1 (naive matmul): one thread per output element walking the full K dimension, a 4 TFLOP/s baseline.
- A CuTeDSL mental model: how it describes data layout, tiles data, and maps tiles onto GPU operations.
- Kernel 2 (tensor cores, TMA, TMEM): per-CTA tiles of C, TMA with barriers moving A/B tiles into shared memory, tcgen05 MMA accumulating into TMEM, and a per-thread epilogue through registers — 155 TFLOP/s.
- Kernel 3 (swizzling): identifying shared memory bank conflicts as the bottleneck and changing the layout only — 285 TFLOP/s.
The author spent the past six months deep in GPUs and performance engineering, documenting the path to speed-of-light kernels.
More from Infra
- llama.cpp team launches Llama: one-click local AI on your Mac menu bar — Hugging Face · 2026-10-23
- China's daily token use hits 500T, up 4x as average price doubles to ¥13.46 — teortaxesTex · 2026-10-23
- New all-reduce kernels deliver 12% decode speedup for DeepSeek-V4.1 on PCIe-connected GPUs — AlpinDale · 2026-10-23
- Offshore oil rigs could be converted into AI data centers powered by stranded gas — clemnt · 2026-10-23
- Same native UI, two stacks: Swift build is ~80MB Mac-only, Zig build is ~10MB cross-platform — jedisct1 · 2026-10-23
- SurfSense: an open-source local NotebookLM with MCP agents and a prompt-caching lesson — FurtiveMirth · 2026-10-23