From Scratch: Building B200 Attention Kernel to 94.4% of FA4 with 60 Diagrams
JosephJacks_ · x · 2026-08-29
A deep dive into building B200 attention kernels from scratch using CUDA and PTX.
- Goal: Optimize from a naive baseline to achieve 94.4% of FlashAttention-4 (FA4) performance.
- Content: Features 14 kernel iterations and 60 diagrams to visualize each optimization step.
- Progression: Introduces one major optimization at a time (e.g., memory coalescing, Shared Memory, Tiling), pairing concepts with code.
- Application: The final optimized kernel is integrated and tested within a video-generation model.
More from Infra
- Next-gen GraalVM benchmarks: 4x faster startup, 2x less memory, no build step needed — RealGeneKim · 2026-10-15
- How Microsoft optimized Windows for Nvidia's Arm-based RTX Spark AI laptops — tomwarren · 2026-10-15
- How Microsoft optimized Windows for Nvidia's Arm-based RTX Spark laptops — The Verge AI · 2026-10-15
- Global smartphone shipments plunge 22% in worst quarterly decline on record as AI demand fuels memory costs — Polymarket · 2026-10-15
- SK Hynix drops 11% again, now below 3x FY2027 earnings as AI memory selloff deepens — JOBhakdi · 2026-10-15
- ASML Sells Zero Lithography Machines into Europe as US Hosts 75%+ of AI Compute — NinaDSchick · 2026-10-15