FlashAttention
Method · 2022 · Also known as FlashAttention-1
Definition
“Transformers are slow and memory-hungry on long sequences, since the time and memory complexity of self-attention are quadratic in sequence length.”
From the defining paper: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness (Tri Dao, Daniel Y. Fu, Stefano Ermon, et al., NeurIPS 2022).
Lineage
Parent: Multi-head attention
Children: FlashAttention-2
Incoming edges (1)
improves · inference speed
From Multi-head attention · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “Transformers are slow and memory-hungry on long sequences” Source: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Mechanism
- “an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes” Source: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Trade-off
- No trade-off quoted.
Outgoing edges (1)
improves · parallelization
To FlashAttention-2 · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “FlashAttention is still not nearly as fast as optimized matrix-multiply (GEMM) operations” Source: FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Mechanism
- “parallelize the attention computation, even for a single head, across different thread blocks” Source: FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Trade-off
- No trade-off quoted.