Notes

GPU Memory

Everything a language model needs while it is running has to sit in the memory attached to the chip doing the arithmetic. GPU memory — the few tens of gigabytes of high-bandwidth RAM on the card itself — is the hardest constraint in the field, and it decides which models you can run at all.

What fills it up
  • Weights: about 2 bytes per parameter at half precision, so a 70B model wants roughly 140 GB before anything else, which is more than any single card holds.
  • The KV cache: stored attention keys and values for every token in the conversation so far, growing with sequence length and with each concurrent user. On long-context serving it can outweigh the model itself.
  • Training adds gradients and optimizer states. With Adam that pushes the requirement toward 16 bytes per parameter, which is why training needs an order of magnitude more memory than inference.
Why it shapes every decision

Running out is not graceful degradation, it is an out-of-memory crash in the middle of a request. Nearly every well-known technique in model serving exists to dodge this wall: quantization to shrink the weights, tensor parallelism and ZeRO sharding to spread them across cards, paged KV caches in vLLM so fragmentation stops wasting what you have.

Capacity is only half the story. Generating one token means reading every weight once, so decoding speed is set by memory bandwidth rather than by compute. A current data-centre card is fast at inference largely because its memory is fast — and that is why a model which merely fits still often runs disappointingly.

GPU memory is the high-bandwidth RAM on an accelerator, which must hold a model's weights, its KV cache and, during training, gradients and optimizer states. Capacity decides which models run at all: fp16 weights cost about 2 bytes per parameter, so large models exceed a single card and must be sharded or quantized. Bandwidth decides decoding speed, since each generated token requires reading every weight. Exceeding it fails outright rather than slowing down.

A graphics card has its own small, very fast workbench, separate from your computer's main memory. Everything the model is using right now has to fit on that bench. GPU memory is the size of it. A large language model is essentially a gigantic table of numbers, and the whole table has to be laid out there before the model can answer anything. If it does not fit, the model does not run slowly — it simply refuses to start. That one limit explains most of the engineering you hear about around these systems: shrinking models down, splitting them across several cards, and being careful about how much conversation is kept.