Module 1 · What the server does with your GPU · Lesson 2
GPU sizing arithmetic
A GPU budget is four numbers (weights times bytes per parameter, KV bytes per token times tokens in flight, activations and graph headroom, and what is left) and the engine flags that implement it; the same three numbers give the speed floors and decide between one GPU, tensor parallel and pipeline parallel.
By the end of this lesson you can
- Compute the KV-cache bytes per token of a model from its config and the serving dtype, including grouped-query attention
- Produce a memory budget for a named GPU that gives the maximum concurrent sequences at a chosen context length, with headroom
- Estimate batch-1 decode speed from weights and memory bandwidth, and prefill time from FLOPs
- Decide between a single GPU, tensor parallel and pipeline parallel for a model that does not fit, and state the communication cost of each
- Read the vLLM flags that implement the budget, and know which to change first when the engine reports preemptions
