GPU memory calculator
Will your model fit?
Pick a model and what you want to do with it. See how much GPU memory it needs, where that memory goes, and which GPUs on our list can hold it.
Estimated GPU memory
Llama 3.1 8B, serving in FP16 / BF16, 8K tokens × 4 at once: about 20.4 GB. Smallest good fit on our list: RTX 5090.
- Weights
- 16.1 GB
- KV cache
- 4.29 GB
On one GPU from our list
- NVIDIA L424 GB · ₹40/hrTight
- RTX 509032 GB · ₹92/hrBest fit
- A100 80GB80 GB · ₹120/hrFits
- RTX 6000 Pro96 GB · ₹140/hrFits
- H100 SXM80 GB · ₹240/hrFits
- H200 SXM141 GB · ₹350/hrFits
An estimate, not a guarantee.
How the estimate works
Public arithmetic, not a black box.
Every number above comes from a few formulas you can check by hand. Real usage also depends on your software, batch sizes and sequence lengths, so treat the result as a starting point.
- Weights
- Parameters × bytes per parameter: 2 for FP16 or BF16, 1 for FP8 or INT8, 0.5 for INT4. An 8B model in FP16 is about 16 GB.
- KV cache
- 2 × layers × KV heads × head dimension × 2 bytes, for every token of context and every request served at once. For Llama 3.1 8B that is 1,31,072 bytes a token.
- Headroom
- The runtime and its buffers need memory too, so an estimate counts as fitting only up to 90% of the card, and as comfortable up to 75%.
- Fine-tuning
- Full fine-tuning with Adam: 16 bytes per parameter (ZeRO, Rajbhandari et al., 2019). LoRA and QLoRA: the frozen model at 2 or 0.5 bytes per parameter, plus adapters assumed at 1% of the model. Activations are not included.
Common questions
How much GPU memory does an 8B model need?
Llama 3.1 8B in FP16 needs about 16.1 GB for its weights. One request with 8K tokens of context adds about 1.07 GB of KV cache, for about 17.1 GB in all. Each further 8K-token request at the same time adds the same again. The smallest GPU on our list with room for one such request is the NVIDIA L4.
Can a 70B model run on one GPU?
Not in FP16: Llama 3.1 70B needs about 144 GB with one 8K-token request, more than any single GPU on our list. In FP8 or INT8 it needs about 73.3 GB, which fits on RTX 6000 Pro or H200 SXM. In INT4 it needs about 38.0 GB. Quantization can affect output quality, so test it on your own prompts.
Why does fine-tuning need so much more memory?
Full fine-tuning with Adam keeps weights, gradients and optimizer state: about 16 bytes per parameter, or about 128 GB for an 8B model before activations. QLoRA freezes a 4-bit copy of the model and trains small adapters, which brings the same model to about 5.30 GB before activations.
Tell us what you need to run.
DECOM AI is in early access. Share your GPU requirements, and an engineer will follow up.