FlashAttention is an IO-aware exact attention implementation: it tiles
QKT into SRAM, uses online softmax with running max
mi and normalization factor
li (recursively rescaled when merging blocks:
mnew=max(m,mlocal)), never writes the
O(n2) attention matrix back to HBM in the forward pass, and recomputes rather than stores in the backward pass; the motivation is the ~10-20x bandwidth gap between HBM and SRAM (A100: 40GB HBM vs ~108KB SRAM).