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.

At N = 8,192

MethodGrowthMemoryFits 80 GB