AI Hardware & Software Stack
A 7-billion-parameter (7B) model is trained with weights, gradients and Adam's two states all held in FP32 (4 bytes). Excluding activations, roughly how much memory is needed?
- AAbout 28 GB
- BAbout 112 GB
- CAbout 14 GB
Show answer and explanation
Answer: B. About 112 GB
Per parameter there are 4 bytes for the weight, 4 for the gradient and 4 each for Adam's first and second moving averages, 16 bytes in total. 7 billion × 16 bytes = 112 billion bytes, about 112 GB, before adding activation memory. This often does not fit on one GPU, so techniques such as sharding optimizer state across GPUs or keeping it in lower precision are used.
- A. That is the weights alone.
- B. Correct. 16 bytes per parameter.
- C. That is FP16 weights alone.