💻

Llama 3.1 70B GPU Memory Calculator

Exact VRAM memory allocation, dynamic KV-cache requirements, and tensor parallelism slicing for Llama-3.1 70B Enterprise quantized in FP16 Uncompressed Native deployed on NVIDIA H100 80GB SXM5.

🎛️ Architecture & System Parameters
Reactive Compute Engine

Engineering Execution Protocol

  1. Use 70 (the exact model is 70.6B) and choose the precision you will deploy.
  2. Set context to your longest expected prompt plus output, up to 131,072 tokens.
  3. Turn the GPU count into a valid tensor-parallel size: 2, 4 or 8 for this model's 64 attention heads.

Technical Authority & System Specifications

Q: How many H100s does Llama 3.1 70B need in BF16?

The default case totals 149.8 GB, a memory minimum of 3 × 80 GB. Engines need an even split of 64 heads, so BF16 serving normally uses 4 GPUs.

Q: Does FP8 Llama 3.1 70B fit on one H100?

Barely: the calculator total is 75.8 GB, leaving almost no room for KV cache. Two GPUs is the practical FP8 setup.

Q: How big is the real KV cache?

80 layers × 8 KV heads × 128 dimensions × 2 (keys and values) × 2 bytes is 327,680 bytes per token in BF16, about 0.31 MiB.

About Llama 3.1 70B

Llama 3.1 70B is the middle model of Meta's July 2024 Llama 3.1 family, published as both a pretrained base model and an instruction-tuned chat model. Its exact size is about 70.6 billion parameters; this calculator rounds the default to 70. It has 80 transformer layers, a hidden size of 8,192, 64 query heads sharing 8 key-value heads, and a 128K-token context window, up from 8K in Llama 3. Because both base and instruct weights exist, 3.1 70B is the usual starting point for fine-tuning. Llama 3.3 70B, released later, is an instruct-only model with the same architecture, so the memory figures below apply to both.

The formula, step by step

weights_GB = 70 × (bits ÷ 8)
kv_GB = context × batch × kv_per_token_MB ÷ 1024, where kv_per_token_MB = 0.5 at 16-bit and 0.25 at 8-bit or below
total_GB = weights_GB + kv_GB + 1.8
GPUs = ceil( total_GB ÷ (0.92 × GPU_GB) )

For a 70B model the calculator's 0.5 MB-per-token reference is used directly, so this is the page where its KV rule is closest to its source. The model's real BF16 cache is 2 × 80 layers × 8 KV heads × 128 dims × 2 bytes = 327,680 bytes per token (0.31 MiB), so the rule still overstates it by about 60%. Halving the cache at 8-bit corresponds to running an FP8 KV cache, which vLLM and TensorRT-LLM support but do not enable by default.

Example: what the default inputs produce

LineWorkingShown
Model weights70 × 2 bytes140.0 GB
KV cache8,192 × 2 × 0.5 MB ÷ 10248.0 GB
Overheadconstant1.8 GB
Total VRAM140 + 8 + 1.8149.8 GB
Minimum GPUs149.8 ÷ 73.6 = 2.04 → round up3 × 80 GB

Three GPUs is the memory minimum, but most engines cannot split 64 attention heads and 8 KV heads three ways. A BF16 deployment therefore normally uses tensor parallelism across 4 GPUs, or 2 × H200 (141 GB each). With the exact 70.6B parameter count the weights come to about 141 GB, which does not change the conclusion.

Long context is where the cache takes over

Raise the context to the full 131,072 tokens for a single request and the calculator's cache becomes 64 GB at 16-bit, for a total of 205.8 GB. With the real per-token size the cache is about 43 GB. Either way, one full-length 128K conversation costs roughly a third to half as much memory as the model itself. If you plan for long documents, size for the longest prompt plus output you will accept, multiplied by how many such requests may be in flight.

Fitting it to real hardware

SetupPrecisionCalculator totalComment
4 × H100 80 GBBF16149.8 GB at 8K × 2Standard unquantized serving with room for batching
2 × H100 80 GBFP875.8 GBCommon production choice; leaves about 70 GB for cache
1 × H100 80 GBFP875.8 GBTechnically fits under the 95% line, but almost no cache room
1 × 48 GB workstation card4-bit40.8 GBSingle-user use with short contexts
2 × 24 GB consumer cards4-bit40.8 GBWorks with llama.cpp or exllama-style splitting; slower than one larger card

Note an inconsistency you may see when you choose FP8 with the default settings: the status line says the model fits on a single 80 GB GPU, because 75.8 GB is under 95% of 80 GB, while the GPU count says 2, because it uses the stricter 92% figure. Treat the stricter number as the planning answer: a single card with only 4 GB spare cannot hold a useful batch.

Limitations

  • The calculator rounds the model to 70B and uses a generic cache rule; the true weights are slightly larger and the true cache somewhat smaller.
  • Fine-tuning needs far more memory than inference: gradients and optimizer states roughly multiply full fine-tuning memory several times over. Parameter-efficient methods such as LoRA or QLoRA are the usual way to tune 70B on a few GPUs. This page only covers inference.
  • Quantization quality varies by method and task. Run your own evaluation before replacing BF16 with a 4-bit build in production.
Sources: Llama 3.1 70B model card · Llama 3.1 70B Instruct · Meta Llama 3.1 announcement · vLLM FP8 KV cache documentation. Figures were checked against these pages in October 2026; vendors sometimes revise them.
Primary System Output
Calculating...
HARDWARE ARCHITECTURE ACTIVE
ADVERTISEMENT
Tool #29 of 101,000 Compute Matrix
Calculated Output
Calculating...
✓ Architecture specification report copied to clipboard!