How attention memory and compute grow with N
Both axes are logarithmic, so a steeper line means a higher power of N. Dense attention has slope 2; the approximations all bend that down toward slope 1. Values are for a 24-layer, 16-head model (head dimension 64), one sequence, fp16.
▶ Play
Next marker ›
Memory
FLOPs
Show FlashAttention (2022)
sequence length N =
8,192
At N = 8,192
Method
Growth
Memory
Fits 80 GB