Iterative Accumulation: Softmax Normalization in One Pass

The single-pass algorithm iteratively updates the maximum value and log-sum-exp for each token, allowing the softmax normalization constant to be computed and applied 'on-the-fly' without storing the full, large attention matrix, a key to FlashAttention's efficiency.

Sources

Open the full topic