Skip to content
inference.academy

glossary/compute/flash-attention

FlashAttention

An attention kernel that never writes the full attention matrix to HBM. It processes keys and values in tiles that fit the GPU's on-chip SRAM, keeping a running softmax so the result is exact, and reads each tile once. Standard attention materialises a matrix that grows with the square of sequence length; this reads memory linear in it. It made long contexts affordable and is the default kernel in every serving engine.


19 TB/s versus 1.5 TB/s

On-chip SRAM against HBM bandwidth on the A100, the gap the tiling exploits, per the paper.


Related