Take the parameter count in billions and multiply by the bytes per weight, which gives gigabytes. Then add about 20% for runtime overhead. The precision sets the bytes:
- FP16 or BF16 takes 2 bytes, so an 8B model's weights take about 16 GB.
- FP8 or INT8 takes 1 byte, so the same weights take about 8 GB.
- 4-bit
Q4_K_Mtakes about 0.6 bytes, so the weights take about 4.8 GB.
8B at FP16: 8 * 2 = 16 GB weights
plus ~20% runtime overhead -> ~19 GB needed
4-bit is not exactly 0.5 bytes per weight. Quantized files also store scales and zero points, and often keep some tensors at higher precision.
The same math settles whether a 70B model fits on one 80 GB card. At FP16 its weights alone are 140 GB, so it does not. At 4-bit they drop to about 42 GB, about 50 GB with overhead, so it fits.
That is the load cost only. Serving adds the KV cache, which grows with context and batch size and can outgrow the weights.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓