Training Memory
A 70B model in BF16 is 141 GB of weights — and about 1.13 TB of training state before a single activation exists. This module derives all five terms from the update rule that requires them, then hands you a calculator to size real runs. It ends deliberately at the point where parameter sharding stops helping, which is where distributed training has to begin.
Core path ~31 min: 01 → 04 then 07 · Systems deep dive +24 min: 05 → 06
What problem existed?
Goal: By the end of this step, you can explain why a model that fits in memory still cannot be trained in memory.
Suppose the weights load successfully, but the first training step runs out of memory. What did loading the model leave out? To answer that, follow what training needs to do beyond producing a prediction.
Backward needs gradients for the parameters. Adam also needs a running estimate of each gradient and its square. In the mixed-precision recipe we will use here, an FP32 master copy of the weights accumulates updates that could otherwise be lost when rounded into BF16. Each of those jobs needs storage.
Count one parameter before counting billions: two bytes for its BF16 weight, two for its gradient, four for the master copy, and four for each of Adam’s two moments. That is 16 bytes, not just the two bytes we counted when loading the weights. Other precision and optimizer choices change this recipe, so we will keep that assumption visible.
There is one more category. Backward needs intermediate results from forward: the activations. Their size depends on what we run through the model, not just how many parameters it has. A longer sequence or larger micro-batch can exhaust memory even though the weights have not changed.
Our goal is to separate these costs before choosing a fix. Once we know what is taking the space, reducing memory becomes a concrete trade-off rather than a search through configuration flags.
Two different scaling laws under one memory budget. Every lever touches one of them, not both.
How this comes up in interviews
Try answering out loud before revealing.
Which memory term cannot be computed from parameter count alone?
You have the mechanism. These teams had to decide with it under a production constraint — and you commit to an architecture before you are shown theirs.