FlashAttention-2 (Dao, 2023) reduces non-matmul work by keeping the output unnormalized while streaming over key blocks, and dividing by the softmax denominator only once at the end.
Implement finalize_output(acc, l), dividing the accumulator by the denominator row by row.
l has one entry per query row.Divide each row of the accumulator by its denominator, broadcasting over the feature axis.
No results yet
Run your code to check it against the examples, or submit to run every test.