FlashAttention-2
FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
Tri Dao · ICLR 2024
Improve thread-block and warp work partitioning while reducing non-matmul operations and communication.
What you will implement
A CPU specification of single-head square attention, including causal masks, tail blocks, numerical stability and autograd; no GPU warp timing.
- 157. FlashAttention-2 Delayed Normalization and Query Blocks
Stream K/V for each query block, maintaining unnormalized outputs and returning logsumexp.
A CPU specification of single-head square attention, including causal masks, tail blocks, numerical stability and autograd; no GPU warp timing.