Bet 02 / Memory bandwidth
Decode reads the whole model from memory for every token and does almost no arithmetic, so it lives far below the ridge point. Prefill is the opposite. The roofline is the diagnosis; the levers your research pulls, KV-cache pressure and kernel efficiency, are on it too. Set your configuration and watch where it lands and how much headroom is left.
= 2·params·B / (weight bytes + KV bytes), which is tiny, so you are memory-bound.≈ 2·context·B / bytes-per-param, high enough to be compute-bound.= 2 · layers · context · B · (d_model / GQA groups) · bytes. At long context it rivals the weights, which is why decode gets slower as the conversation grows.= efficiency × peak, so a PyTorch kernel at 11% and a Triton kernel at 88% differ by ~8× on the same memory-bound op.Peak figures are approximate dense tensor throughput and HBM bandwidth per vendor spec, scaled by precision.