FlashAttention: Speeding Up Attention, Reducing Memory

FlashAttention significantly reduces memory traffic and usage (up to 10x) by avoiding the materialization of the full attention matrix in High Bandwidth Memory (HBM). It computes attention in blocks within faster SRAM, leading to 2-4x faster attention computation and enabling LLMs to handle much longer context windows, like 128K tokens.

Sources

Open the full topic