Skip to main content
← Lab

flashsoftmax

confirmedC++ · CPUSystems & data structuresJuly 6, 2026

the question

What does the online (flash-attention) softmax reduction actually cost?

what came out

It's numerically identical to two-pass at every context length -- the streaming rescale accumulates nothing -- but ~2.8x slower standalone. Its win is fusion (avoiding a second pass over memory), not raw speed. Pre-registered, long-double oracle.

method & receipts

  • Result: confirmed
  • Pre-registered the prediction was written down and committed before the run.
  • Reproducible one script re-runs the whole thing from scratch.
  • Independently reviewed an adversarial review pass, kept in the repo.
  • Machine-readable claims every reported number, in a checkable file.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/flashsoftmax