2/11
Part 1 of 7 · Why split a modelLearn
A big model doesn't fit on one GPU, to serve or to train
The outdoor shop's 7-billion-parameter model from the latency lesson fits on one GPU. Now the shop wants a 70-billion-parameter model, to serve and to fine-tune on its support transcripts. Take Llama 3 70B's shape: 80 layers, a model dimension of 8,192, 64 attention heads and 8 key-value heads.
Serving keeps the weights in bf16, 2 bytes each. Training with Adam in mixed precision needs 16 bytes a parameter, as the ZeRO paper counts it: 2 for the bf16 weights, 2 for their gradients, and 12 for fp32 copies of the parameters, the momentum and the variance.
# Llama 3 70B's size, rounded
params = 70e9
print(f"serving in bf16: {params * 2 / 1e9:6,.0f} GB of weights")
print(f"training with Adam: {params * 16 / 1e9:6,.0f} GB of weights, gradients and optimizer states")
print(f"one H100: {80:6,} GB")
How many 80 GB GPUs does the training state alone fill, before any activations?
Pick one to see what it prints.
Pick an answer above to see the rest
Which of the three splits do you think needs the fastest links between GPUs?
Pick an answer above to see the rest