Guide · Memory planning

How much GPU memory does a 70B model need?

Short answer: about 140 GB for the weights at FP16/BF16, 70 GB at 8-bit and 35 GB at 4-bit, plus memory for the KV cache and runtime. Training needs far more: roughly 1.1 TB before activations.

· 2 min read · AnthroPrime

Calculator

Estimate inference memory

Estimated total≈ 164 GB
Weights
140 GB
KV cache
2.7 GB
15% allowance
21 GB
GPUs needed for this estimate
L40S48 GBA100 / H10080 GBH200141 GBB200180 GB
4 GPUs4 GPUs2 GPUs1 GPU

Planning estimate for inference, rounded to 1, 2, 4 or 8 GPUs. Real usage depends on the inference engine and its settings; measure before you commit.

Step 1: the weights

Weight memory is the parameter count multiplied by the bytes per parameter. FP16 and BF16 use 2 bytes, FP8 and INT8 use 1 byte, and 4-bit formats use half a byte (plus a little metadata).

Step 1: the weights
PrecisionBytes per parameter70B weights
FP16 / BF162≈ 140 GB
FP8 / INT81≈ 70 GB
4-bit0.5≈ 35 GB

Step 2: the KV cache

During generation the model stores keys and values for every token in every layer. Per token that is 2 × layers × KV heads × head dimension × bytes.

For a Llama 3 70B-style model (80 layers, 8 KV heads with grouped-query attention, head dimension 128) at FP16 that is about 0.33 MB per token. One 8,192-token conversation needs about 2.7 GB; 32 of them at once need about 86 GB, more than the weights at 8-bit.

  • Longer contexts grow the KV cache linearly
  • More concurrent users multiply it
  • FP8 KV cache halves it, where your engine supports it

Step 3: leave headroom

Activations, CUDA context, framework buffers and memory fragmentation all take space. This guide adds 15% of the weight size as a planning allowance. Real usage depends on the inference engine and its settings, so treat it as a starting point and measure.

Training needs much more

Full training with mixed precision and the Adam optimiser typically needs about 16 bytes per parameter: BF16 weights and gradients plus an FP32 master copy and two optimiser moments. For 70B that is about 1.1 TB before activations, so training is spread across many GPUs with techniques such as ZeRO or FSDP sharding.

Parameter-efficient fine-tuning (LoRA, QLoRA) needs far less, because the base weights stay frozen and only small adapters are trained.

What fits where

The table below estimates how many GPUs a 70B model needs for inference with one 8K-token conversation in FP16 KV cache, including the 15% allowance, rounded up to 1, 2, 4 or 8 GPUs (the usual tensor-parallel sizes). Use the calculator above for your own context length and concurrency.

GPUs needed for a 70B model by precision
70B weightsL40S (48 GB)A100 / H100 (80 GB)H200 (141 GB)B200 (180 GB)
FP16 / BF164 GPUs4 GPUs2 GPUs1 GPU
FP8 / INT82 GPUs2 GPUs1 GPU1 GPU
4-bit1 GPU1 GPU1 GPU1 GPU

L40S has no NVLink, so multi-GPU tensor parallelism runs over PCIe; for larger models NVLink GPUs are usually the better fit.

Frequently asked questions

Can a 70B model run on one 80 GB GPU?

At 4-bit (about 35 GB of weights) yes, with room for the KV cache. At 8-bit the weights are about 70 GB, which leaves little room on an 80 GB GPU, so expect short contexts or low concurrency. FP16 needs at least two 80 GB GPUs.

Does quantisation affect quality?

It can. 8-bit is usually close to FP16 quality; 4-bit saves more memory but needs evaluation on your own tasks.

Why does my server run out of memory with more users?

Each concurrent request has its own KV cache. With long contexts the KV cache can exceed the weights, so plan memory for peak concurrency, not for one request.

Sources: Hugging Face · KV cache ↗ · Hugging Face · Model memory estimation ↗