FlashAttention Explorer
Explore and compare attention optimization techniques for large language models
Explore the concepts hands-on with the FlashAttention Explorer:
Try the FlashAttention Explorer
Benchmark attention backends on real models, compare GQA vs MQA memory usage, analyze prefill vs decode phases, and calculate memory budgets with configurable precision.
2.1: Standard Attention — The IO Problem
How the naive softmax(QK^T/√d)V implementation creates 33× more memory traffic than necessary, and why softmax's global dependency forces the N×N matrix to be written to HBM.
2.2a: FlashAttention — The Tiling Strategy
Dividing Q, K, V into blocks that fit in SRAM so the N×N matrix never needs to exist in HBM. The loop structure, why reloading K/V blocks is cheap, and where tiling helps most.
2.2b: FlashAttention — Online Softmax
Computing exact softmax from partial scores. Tracking a running max and sum, rescaling when the max changes, and why this produces the same result as standard softmax.
2.2c: FlashAttention — IO Analysis and Evolution
Quantifying the IO improvement, why more FLOPs can mean less time, and what FlashAttention-2 and FlashAttention-3 changed.
This is Part 2 of a series on LLM systems. Part 1 covers inference foundations — the autoregressive loop, KV cache, prefill vs decode, and the utilization paradox.
Explore and compare attention optimization techniques for large language models