Short answer
How many GPUs to train an LLM depends on two limits. The compute limit: training needs about 6 × parameters × tokens FLOPs, so GPUs = total FLOPs ÷ (GPU speed × utilisation × time available). The memory limit: full training with Adam needs about 16 bytes per parameter plus activations. Assuming H100s at 40% utilisation, a 1B model on 20B tokens needs about 83 GPU-hours (one GPU for 3.5 days); a 7B model on 1 trillion tokens needs about 29,000 GPU-hours (about 41 H100s for 30 days); and a 70B model on 15 trillion tokens needs about 4.4 million GPU-hours (about 2,000 H100s for 90 days). For reference, Meta trained Llama 3.1 405B on 16,384 H100s using about 30.8 million GPU-hours, and DeepSeek-V3 used 2,048 H800s and 2.79 million GPU-hours.
Formula 1: compute (time)
Total FLOPs ≈ 6 × N × D
GPU-hours = Total FLOPs ÷ (peak FLOP/s × MFU × 3,600)
GPUs needed = GPU-hours ÷ hours available- N = parameters, D = training tokens
- Peak FLOP/s = dense BF16 throughput (H100: 989 TFLOPS; B200: ~2,250 TFLOPS)
- MFU (model FLOPs utilisation) = realistic share of peak, typically 30–50%; see MFU explained
With H100 at 40% MFU, each GPU delivers about 4 × 1014 useful FLOP/s, or 1.44 × 1018 FLOPs per GPU-hour.
Formula 2: memory (minimum GPUs)
| Item | Bytes per parameter (mixed precision with Adam) |
|---|---|
| BF16 weights | 2 |
| BF16 gradients | 2 |
| FP32 master weights | 4 |
| Adam first and second moments (FP32) | 8 |
| Total | ~16 |
Minimum GPUs (memory) ≈ (16 × N) ÷ GPU memory (with sharding such as FSDP/ZeRO)Activations add more, depending on sequence length and batch size; activation checkpointing reduces them. A 7B model needs about 112 GB for model states alone, so at least two 80 GB GPUs with sharding, and in practice 4–8. See distributed training parallelism.
Final answer = the larger of the compute and memory requirements.
Worked examples (H100, 40% MFU)
| Model | Tokens | Training FLOPs | H100 GPU-hours | GPUs for 7 days | GPUs for 30 days | GPUs for 90 days | Min. GPUs (memory) |
|---|---|---|---|---|---|---|---|
| 124M | 10B | 7.4 × 1018 | ~5 | 1 | 1 | 1 | 1 |
| 1B | 20B | 1.2 × 1020 | ~83 | 1 | 1 | 1 | 1 |
| 1B | 1T | 6.0 × 1021 | ~4,200 | ~25 | ~6 | ~2 | 1 |
| 7B | 1T | 4.2 × 1022 | ~29,000 | ~174 | ~41 | ~14 | ~2–8 |
| 7B | 15T | 6.3 × 1023 | ~438,000 | ~2,600 | ~610 | ~200 | ~2–8 |
| 70B | 2T | 8.4 × 1023 | ~583,000 | ~3,500 | ~810 | ~270 | ~16–32 |
| 70B | 15T | 6.3 × 1024 | ~4.4 million | ~26,000 | ~6,100 | ~2,000 | ~16–32 |
| 405B | 15.6T | 3.8 × 1025 | ~26 million | — | ~37,000 | ~12,200 | ~100+ |
Using B200s instead: at the same 40% MFU, each B200 delivers about 2.3× the BF16 throughput of an H100, so divide GPU counts by roughly 2.3 (more with FP8 training). See NVIDIA B200 specs.
Real-world training runs
| Model | GPUs | GPU-hours | Notes |
|---|---|---|---|
| Llama 3.1 8B | H100s | ~1.46 million | ~15T tokens; far beyond compute-optimal |
| Llama 3.1 70B | H100s | ~7.0 million | |
| Llama 3.1 405B | 16,384 H100s | ~30.8 million | ~3.8 × 1025 FLOPs; ~38–43% MFU reported |
| DeepSeek-V3 (671B MoE, 37B active) | 2,048 H800s | ~2.79 million | ~$5.6 million at $2/GPU-hour; final run only |
| GPT-2 124M reproduction (llm.c) | 8 A100s | ~12 (about 90 minutes) | ~$20 in 2024 |
Our formula predicts about 26 million H100-hours for Llama 3.1 405B; Meta reported 30.8 million, which includes real-world inefficiencies such as failures and restarts. Meta also reported 419 unexpected interruptions in a 54-day period on its 16,384-GPU cluster, a reminder that reliability matters at scale. See how long do GPUs last?
How many GPUs for fine-tuning?
| Task | Model | GPUs needed (typical) |
|---|---|---|
| QLoRA | 7–8B | 1 × 16–24 GB GPU |
| QLoRA | 70B | 1 × 48–80 GB GPU |
| LoRA (16-bit) | 7–8B | 1 × 24 GB GPU |
| LoRA (16-bit) | 70B | 2–4 × 80 GB GPUs |
| Full fine-tuning | 7–8B | 2–8 × 80 GB GPUs |
| Full fine-tuning | 70B | 16–32 × 80 GB GPUs |
See What is LoRA? and What is fine-tuning?
Cost estimates
At the December 1, 2026 median H100 rental price of $3.92/hour (lowest $1.80) from our GPU price report:
| Model | H100 GPU-hours | Cost at $3.92/hr | Cost at $1.80/hr |
|---|---|---|---|
| 1B on 20B tokens | ~83 | ~$330 | ~$150 |
| 7B on 1T tokens | ~29,000 | ~$114,000 | ~$52,500 |
| 70B on 15T tokens | ~4.4 million | ~$17 million | ~$7.9 million |
Large training runs usually use reserved capacity at lower negotiated rates. Use our training cost calculator and see LLM training cost.
What changes the answer
| Factor | Effect |
|---|---|
| MFU (software efficiency) | 50% instead of 30% MFU needs 40% fewer GPUs |
| Precision | FP8 training on Hopper/Blackwell can nearly double throughput |
| GPU generation | B200 ≈ 2.3× H100 (BF16); see Hopper vs Blackwell |
| Interconnect | Slow networking lowers MFU at scale; see InfiniBand vs Ethernet and NVLink |
| Sequence length | Longer contexts add attention compute and activation memory |
| Mixture of experts | Compute scales with active parameters (6 × active N × D) but memory with total parameters |
| Failures and restarts | Add 10–20%+ to real GPU-hours at large scale |
| Experiments | Ablations and failed runs often exceed the final run's cost |
Frequently asked questions
How many GPUs did it take to train GPT-4?
OpenAI has not disclosed it. Estimates suggest tens of thousands of A100-class GPUs over several months, but these are unconfirmed.
Can I train an LLM on one GPU?
Yes, small models: a 124M–350M model trains on one modern GPU in hours to days, and a 1B model on tens of billions of tokens in days.
How many GPUs do I need to train a 7B model?
For 1 trillion tokens in about a month, roughly 40 H100s; for 15 trillion tokens in a month, roughly 600. You need at least 2–8 GPUs just to fit the training state.
What is the 6ND formula?
An approximation of training compute: 6 FLOPs per parameter per token (2 for the forward pass, 4 for the backward pass).
Sources and further reading
- Kaplan et al., Scaling Laws for Neural Language Models (2020)
- Meta, The Llama 3 Herd of Models (2024) and Llama 3.1 model card
- DeepSeek-AI, DeepSeek-V3 Technical Report (2024)
- Rajbhandari et al., ZeRO: Memory Optimizations Toward Training Trillion Parameter Models (2020)
- TensorCore.si, GPU cloud price report (December 1, 2026)




Leave a Reply