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
- Cloudflare turns global network into agentic cloud with Dynamic Workers and AI Gateway — dscape · 2026-09-01
- LLM-Checker: CLI Tool Scans Hardware to Recommend Optimal Local LLMs — _jaydeepkarale · 2026-09-01
- Europe orders €387.8M AI supercomputer to boost dedicated AI network — emmanuelvivier · 2026-09-01
- Debugging slower speeds with MTP enabled on Gemma 4 12B QAT — NovaXeros · 2026-09-01
- Loudoun County data centers covering <3% of land expected to generate $1B+ in revenue — rohanpaul_ai · 2026-09-01
- llama.cpp AMD GFX906 fork: +14% PP, +9% long-context fill vs upstream — milpster · 2026-09-01