Most "long-context is expensive" discussions stop at "KV cache is big". That is true and also useless. Here is where the cost actually lands, and the handful of numbers that tell you whether your bottleneck is memory capacity, memory bandwidth, or the attention kernel.

1) KV cache size: the arithmetic you can do on paper
- Per token, per layer: 2 (K and V) × heads × head_dim × bytes. For a Llama-3-70B-style config with 64 heads of 128 dim, GQA 8 KV heads, that is 2 × 8 × 128 × 2 bytes = 4 KiB per token per layer, and ×80 layers ≈ 320 KiB/token.
- So 128K tokens on one sequence ≈ 40 GiB. On H100 80GB that is one sequence per GPU, minus weights — which is why sharding is not optional above ~32K.
- The practical threshold: once KV exceeds ~25–30% of HBM, decode throughput drops sharply because you start evicting weights or falling back to recompute.

2) Bandwidth: the number people forget
- Decode reads the whole KV cache for every generated token. At 128K context on 8× H100 (3.35 TB/s each), reading 40 GiB takes ~12 ms of pure bandwidth — before any compute and before any all-reduce.
- This is why context length hurts time-to-second-token far more than time-to-first-token: prefill is compute-bound and cheap per token (it batches), decode is bandwidth-bound and scales linearly with context.
- Rough planning rule: tokens/s at long context ≈ achievable HBM bandwidth / KV bytes read per step. If you measure a big gap from that, you are not bandwidth-bound; you are stalling somewhere else.

3) The attention kernel is where measurements disagree
- FlashAttention-class kernels with paged KV get you most of the way, but the page size matters: 16-token pages waste up to 15 tokens of read amplification per page; 256-token pages reduce fragmentation cost but hurt prefix sharing granularity.
- Prefix caching is the single biggest win in agent workloads, where 80–90% of the prompt is reused across turns. Measured effect in our traces: TTFT down 3–5× on multi-turn tool loops, with no change in model quality.
- Watch for the silent killer: continuous batching mixed with long and short requests. A 128K request in the same batch as 2K requests can halve the short requests' throughput, because the scheduler waits on the long decode step.

4) What to actually measure
- Report four numbers separately: TTFT at 4K / 32K / 128K; decode tokens/s at the same three lengths; KV bytes/token (from config, not from guess); and GPU memory used vs reserved.
- If decode tokens/s at 128K is within ~20% of your bandwidth estimate, you are healthy and the fix is hardware. If it is 2× off, look at paged-KV fragmentation and batch composition first.
- Common misjudgement: attributing long-context slowness to the model or the framework when the actual cause is a batch scheduler mixing lengths, or a KV cache that got fragmented after a few hours of uptime.

Discussion: in your long-context serving stack, what did you find first — KV capacity, HBM bandwidth, or the scheduler mixing short and long requests? And has prefix caching actually paid off for you, or did hit-rate turn out lower than expected?