Standard attention writes the full n by n score matrix to GPU high-bandwidth memory and reads it back, and the bottleneck is memory traffic, not arithmetic.
FlashAttention tiles the computation so blocks of Q, K and V stay in fast on-chip SRAM and uses an online softmax, never materializing the full matrix.
The result is the same exact output, with much lower memory use and faster speed, enabling longer sequences.
Loading…