Check whether a model fits in four steps
- 1
Work out the weights
Multiply the parameter count in billions by the bytes per weight. FP16 is 2 bytes, FP8 is 1 byte and 4-bit is about 0.5 byte, and we use 0.55 to allow for scales and other overhead. A 70 billion parameter model is about 140 GB at FP16, 70 GB at FP8 and 38.5 GB at 4-bit.
- 2
Add the KV cache
For each sequence, the KV cache is 2 x layers x KV heads x head size x bytes per value x tokens. It grows with context length and with the number of requests you serve at once.
- 3
Keep headroom
We hold back 15% of each card for the CUDA context, activations and fragmentation, so one 48 GB card has about 41 GB to use. This is an assumption. Your software may need more or less.
- 4
Pick the card count
Choose the smallest size whose usable memory holds the weights and the KV cache you need. When a model spans cards, test the speed, because splitting a model across cards adds communication work.
Weights by model size and precision
Each cell is the weight memory, then the smallest number of 48 GB cards that holds it with 4 GB left for the KV cache, using the 15% hold back above. The sizes are generic: a "70B" row means any model of about 70 billion parameters. These are estimates, not benchmarks.
| Parameters | FP16 (2 bytes) | FP8 (1 byte) | 4-bit (about 0.55 byte) |
|---|---|---|---|
| 8B | 16 GB, 1x | 8 GB, 1x | 4.4 GB, 1x |
| 14B | 28 GB, 1x | 14 GB, 1x | 7.7 GB, 1x |
| 32B | 64 GB, 2x | 32 GB, 1x | 17.6 GB, 1x |
| 70B | 140 GB, 4x | 70 GB, 2x | 38.5 GB, 2x |
| 405B | 810 GB, more than 8x | 405 GB, more than 8x | 222.8 GB, 8x |
The KV cache, with numbers
The KV cache stores the keys and values of every token so far. For a model with 32 layers, 8 KV heads and a head size of 128 (a shape common to 8B models) at FP16, one token costs 0.13 MB, so an 8,192 token sequence is about 1.1 GB. For a model with 80 layers, 8 KV heads and a head size of 128 (a shape common to 70B models), an 8,192 token sequence is about 2.7 GB, and a 32,768 token sequence is about 10.7 GB. Always read the real layer and head counts from your model's config file.
A KV cache stored at FP8 is about half of these figures, if your serving software supports it.
Worked examples
An 8B model at FP16 on 1x: the weights are 16 GB. Eight sequences of 8,192 tokens add about 8.6 GB, for 24.6 GB in total. That is inside the 41 GB we treat as usable.
A 32B model at FP8 on 1x: the weights are 32 GB, which leaves about 8.8 GB for the KV cache and activations. That is room for a few short sequences, so keep the context modest.
A 70B model at FP8 on 2x: the weights are 70 GB and two cards give about 82 GB usable, which leaves about 11.6 GB. At 2.7 GB per 8,192 token sequence, that is about 4 sequences at once.
A 70B model at FP16 on 4x: the weights are 140 GB and four cards give about 163 GB usable, which leaves about 23.2 GB, or about 8 sequences of 8,192 tokens.
A mixture of experts model keeps all of its experts in memory, so size it by its total parameter count, not by the parameters it uses for each token.
When to rent 2x, 4x or 8x
Use these as a first guess, then test.
- 1x (48 GB): models up to about 8B at FP16, about 32B at FP8 or about 60B at 4-bit with short contexts.
- 2x (96 GB): a 70B model at FP8, or a 32B model at FP16.
- 4x (192 GB): a 70B model at FP16 with room for a long KV cache, or several copies of smaller models.
- 8x (384 GB): the largest open models at FP8 or 4-bit, or many copies of a small model to serve more users.
- More cards also help when you want to run separate copies of a model for more users at once, with no splitting at all.

