Building B200 Attention Kernel from Scratch to Near-SOTA in 60 Diagrams
dejavucoder · x · 2026-09-01
This blog post details building a dense B200 Attention Kernel from scratch using CUDA and PTX, reaching 94.4% of FlashAttention-4 performance, supported by 60 diagrams.
Key Content:
- Intuitive Understanding: Develops an intuitive grasp of the naive kernel baseline.
- Step-by-Step Optimization: Adds one major optimization at a time, paired with detailed diagrams and code.
- Benchmarks: Performance is tested on 4K, 8K, and 16K shapes.
- Capstone Project: Integrates the final kernel into a video-generation model.
The post aims to provide a foundation for GPU kernel research on the latest hardware, noting that concepts apply beyond B200. Suitable for CUDA beginners and developers seeking deep optimization insights.
More from Infra
- SGLang Summit sponsors grow from 11 to 36 in one week; Lip-Bu Tan, Lilian Weng to speak — BanghuaZ · 2026-10-18
- Yacine jokes his datacenter KPI is gigawatt-hours: get paged if not burning enough power — yacineMTB · 2026-10-18
- 1.68x inference speedup drops, directly accelerating GRPO post-training — yacineMTB · 2026-10-18
- OpenRouter is only a fraction of the total addressable market, poster argues — sloppenheimer · 2026-10-18
- Developer builds change alerts for LLM prices and retirements across Bedrock, Azure and Vertex — jsandhu0780 · 2026-10-18
- 12.3M tokens in 27 minutes for $0.14: agent session with 99.6% cache hit — teortaxesTex · 2026-10-18