The Attention Bottleneck — and How FlashAttention Fixed It
Attention is the operation that makes transformers powerful, and for years it was also their worst performance bottleneck — not because it does too much math, but because it moved too much data. FlashAttention is the single most important GPU optimization of the LLM era, and it's a perfect case study in everything this series has built: it's memory-bound, the roofline says so, and the fix is to raise arithmetic intensity by never writing the big intermediate to HBM. Understanding it is understanding how real kernel optimization works.
Naive attention materializes an N×N matrix in HBM — memory-bound and quadratic. FlashAttention fixes it with pure roofline reasoning: tile into shared memory, use an online softmax, fuse the kernel, never touch HBM. The archetype of all inference optimization.