▶Fine-tune Calculator▋

// guides

Multi-GPU LLMs: Data, Tensor and Pipeline Parallelism, FSDP and ZeRO Explained

How many GPUs a model really needs for inference and for training, what each parallelism strategy splits, and what the interconnect does to the answer.

reviewed 2026-11-15 · by Bedino

One GPU is rarely enough for the biggest jobs: a 70B model in 16-bit does not fit on any single card, and a full fine-tune of even an 8B model needs more than 100 GiB. Splitting a model across GPUs works, but “multi-GPU” covers several different strategies that split different things. This guide separates them and gives the numbers.

What can be split

Strategy What each GPU holds Used for
Data parallelism (DDP) A full copy of the model; different slices of the batch Training, when the model fits on one GPU
Sharded data parallelism (FSDP, ZeRO-3) A 1/N shard of parameters, gradients and optimizer state; gathered per layer Training models too big to replicate
Tensor parallelism (TP) A slice of every layer’s weight matrices Inference and training of very large layers
Pipeline parallelism (PP) / layer splitting Whole layers — GPU 1 holds layers 1–40, GPU 2 holds 41–80 Inference on consumer cards; very large training runs

Real systems combine them: a large training run may use tensor parallelism inside a node, pipeline parallelism across nodes and sharded data parallelism across replicas.

Inference: how many GPUs does a model need?

For inference, tensor parallelism splits weights and KV cache nearly evenly, so the rule is:

per-GPU memory ≈ total ÷ N × 1.07      (about 7% overhead for communication buffers)

Using the calculator’s budget (94 percent of each card’s memory is usable) and an 8k context, the minimum number of GPUs is:

Model and format Total RTX 4090 (24 GB) RTX 5090 (32 GB) A100/H100 (80 GB) H200 (141 GB)
Llama 3.3 70B, FP16 135.7 GiB 7 5 2 2
Llama 3.3 70B, Q8_0 74.1 GiB 4 3 2 1
Llama 3.3 70B, Q4_K_M 43.9 GiB 3 2 1 1
Llama 3.1 405B, FP16 762.4 GiB 37 28 11 7
Llama 3.1 405B, Q4_K_M 234.7 GiB 12 9 4 2

Two things stand out. First, quantizing is worth more than adding cards: dropping the 70B model from FP16 to Q4 turns seven consumer GPUs into three. Second, the counts are not powers of two — tensor-parallel engines usually want 2, 4 or 8, so you may need to round up.

Training: sharding the 16 bytes per parameter

Mixed-precision Adam training costs about 16 bytes per parameter (see the fine-tuning memory guide). Plain data parallelism copies all of that onto every GPU, so adding GPUs adds speed but not capacity. Sharding (FSDP or ZeRO-3) divides it:

model states per GPU ≈ 16 bytes × parameters ÷ N

For an 8B model across 8 GPUs that is about 15 GiB per card, plus activations (which are not shared: each GPU processes its own micro-batch). For a 70B model across 8 GPUs it is about 131 GiB per card — still too big for an 80 GB GPU, so a full 70B fine-tune needs 16 or more such GPUs, or switches to LoRA/QLoRA. Sharding is also why the ZeRO and FSDP papers made large-model training practical.

The interconnect

The more finely you split, the more data crosses between GPUs, so the link matters:

  • Tensor parallelism exchanges activations twice per layer. Over NVLink this is cheap; over PCIe it becomes the bottleneck and can erase the benefit of the extra GPUs. Prefer TP only across NVLink-connected cards.
  • Pipeline / layer splitting passes one activation vector per token between stages. PCIe is plenty, which is why two or four consumer GPUs work for personal inference.
  • Sharded data parallelism gathers each layer’s weights just in time, which needs high bandwidth; multi-node runs need a fast network such as InfiniBand or high-end Ethernet.

Speed: do not expect linear scaling

Splitting a model across GPUs for single-stream inference does not make one reply faster. Each token still passes through every layer, so the speed is set by one GPU’s memory bandwidth, not the sum. What you gain is capacity — and, when serving many users, more room for KV cache and larger batches (see the serving guide).

Check your configuration

The multi-GPU split calculator shows the per-card memory at 2, 4 and 8 GPUs for any model, quantization and context, and the minimum number of cards for your GPU choice. For training memory before sharding, use the fine-tuning calculator.

faq
Does tensor parallelism cut memory exactly in half on two GPUs?
Almost, but not exactly. Each GPU holds half of every layer's weights and half of the KV cache, but some tensors (norms, embeddings, communication buffers) are duplicated or add overhead. The calculator allows about 7 percent per-GPU overhead on top of an even split.
Do I need NVLink?
For tensor parallelism across many GPUs, a fast interconnect matters a lot, because every layer exchanges data twice. For splitting layers across two or four consumer cards for single-user inference, plain PCIe works because only small activations cross between GPUs. For large-scale training with sharding, a fast interconnect is strongly recommended.
Why can two 24 GB cards run a model that does not fit one?
Because the runtime places different layers (pipeline or layer splitting) or slices of every layer (tensor parallelism) on each card, so the weights are spread over the combined memory. What you do not get is double speed: each token still flows through all the layers in sequence.
Is FSDP the same as ZeRO?
They are the same idea implemented in different libraries. Both shard the model parameters, gradients and optimizer state across data-parallel GPUs instead of replicating them, gathering what they need layer by layer. PyTorch calls it FSDP, DeepSpeed calls the equivalent ZeRO stage 3.
more guides