On this page
When to use it
GPUGraphics processing unit. The chips most AI models are trained and served on. Read the full explanation counts, memory, training compute, serving cost, cost per token, time to generate data.
The framework
| Step | Ask yourself | What good sounds like |
|---|---|---|
| Restate | What unit is the answer in? | GPUs, at peak. |
| Formula | Write it before numbers | GPUs = peak tokens/s ÷ tokens/s per GPU. |
| Assume | Round numbers, said out loud | ~2,400 tokens/s per 8-GPU server. |
| Compute | Powers of ten | 150k ÷ 2.4k ≈ 63 servers. |
| Adjust | Headroom, utilisation, filtering | +25% headroom → ~80 servers. |
| Sanity-check | Does it match anything known? | Cross-check with KV cacheKey-value cache. Stored attention keys and values that let a model generate each new token without recomputing the whole context. Read the full explanation memory. |
Worked example
A chat product will serve a 70B-parameter model to 1 million daily users. Estimate how many GPUs you need, and what it will cost.: Converts daily usage to peak tokens per second, then servers, then cost per user.
Where people go wrong
- Silent arithmetic
- Sizing for average instead of peak
- False precision
- Forgetting the KV cache or utilisation
Patterns to plug in
- Weights = params × bytes
- Inference ≈ 2N FLOPsFloating-point operation. One arithmetic operation on decimal numbers; FLOPs measure how much compute training or inference takes. Read the full explanation per token; training ≈ 6ND
- KV cache ≈ 2 × layers × KV heads × head size × bytes per token
- Cost per million tokens = $/hour ÷ tokens per hour × 10⁶
Questions to practise with it
- Estimate the compute and cost to train a 7-billion-parameter model on 2 trillion tokens.
- A team wants to serve a 70-billion-parameter model on a single 80 GB GPU to save money. Will it work?
- You're pricing a new model on your API. Serving costs $3 per GPU-hour, and a server of 8 GPUs produces about 2,500 output tokens per second at your latency target. What price per million output tokens?