More GPUs change speed and memory. Data parallel (DDP) copies the model to every GPU and splits the data: faster, but no memory saving. Sharded training (FSDP, DeepSpeed ZeRO-3) splits weights, gradients and optimiser state across GPUs, so larger models fit. If the job fits one GPU, stay on one.
- DDP memory per GPU
- Same as single GPU (full replica)
- FSDP / ZeRO-3 memory per GPU
- ≈ (16–20 bytes × params) ÷ GPU count + activations
- Typical scaling, 8 GPUs, one machine
- Often 6–7.5× speed-up (rule of thumb, workload-dependent)
- Launch commands
- torchrun, accelerate launch, deepspeed
- Effective batch size
- micro-batch × gradient accumulation × GPU count
- Communication library
- NCCL
Adding GPUs is the obvious fix when training is too slow or a model will not fit, but it changes more than the speed. You choose a parallelism strategy, launch differently, think about effective batch size and communication, and pay for every card whether it is busy or not. This guide explains what changes from one GPU to 2, 4 or 8 in one machine, with memory sums, scaling estimates and working launch commands. For the bigger picture, see our GPU model training guide.
Should you use one GPU or several?
Use one GPU if your job fits in its memory and finishes in an acceptable time. One GPU is simpler to debug, wastes nothing on communication, and costs the same per GPU-hour. Move to several when one of three things is true:
- It will not fit. The model, optimiser state and activations exceed one card's VRAM even with LoRA, QLoRA, gradient checkpointing and an 8-bit optimiser. You need sharding.
- It is too slow. The run fits but would take days, and you need results sooner. You need data parallelism.
- You are running many experiments. A hyperparameter sweep is often best as one independent run per GPU, with no communication at all.
A quick decision table for common fine-tuning jobs:
| Job | One GPU? | Multi-GPU option |
|---|---|---|
| 8B QLoRA or LoRA, < 50M tokens | Yes (RTX 4090, L40S) | DDP only if you need it faster |
| 32B QLoRA | Yes (L40S, 80 GB cards) | DDP to speed up |
| 70B QLoRA | Yes (A100 80GB, H100) | DDP across 2–4 cards for speed |
| 70B 16-bit LoRA | Only B200 / B300 | FSDP across 2–4 × 80 GB cards |
| 8B full fine-tune | Only B200 / B300 | FSDP / ZeRO-3 across 4–8 cards |
| 70B full fine-tune | No | 8 × B200 or B300 in one machine; otherwise multi-node |
| Pre-training a 1B model on 20B tokens | Possible but slow (≈ 126 GPU-hours on H100) | DDP across 8 cards: under a day |
What is data parallelism (DDP)?
Distributed Data Parallel (DDP) runs one full copy of the model per GPU, gives each GPU a different slice of every batch, and averages gradients across GPUs after each backward pass with an all-reduce. Every copy then applies the same update, so the replicas stay identical.
What changes:
- Speed: close to linear in one machine. Each GPU processes its own micro-batch in parallel.
- Memory: unchanged per GPU. If it does not fit on one card, DDP will not help.
- Batch size: the effective batch is micro-batch × gradient accumulation × number of GPUs. Going from 1 to 4 GPUs with the same settings quadruples it.
- Communication: one all-reduce of all gradients per step, overlapped with the backward pass. For LoRA, only the adapter gradients are communicated, which is tiny.
What is sharded training (FSDP and DeepSpeed ZeRO)?
Sharded data parallelism splits the model's state across GPUs instead of copying it. Each GPU stores only a slice of the weights, gradients and optimiser state, and gathers the full weights for one layer at a time just before it needs them. PyTorch's Fully Sharded Data Parallel (FSDP) and DeepSpeed's ZeRO (Zero Redundancy Optimizer, arXiv 1910.02054) are the two common implementations.
DeepSpeed names the levels by what is sharded:
| Level | Shards | FSDP equivalent | Memory per GPU (16 B/param model state) |
|---|---|---|---|
| DDP | Nothing | NO_SHARD | 16 × P |
| ZeRO-1 | Optimiser state | – | 4 × P + 12 × P ÷ N |
| ZeRO-2 | Optimiser state + gradients | SHARD_GRAD_OP | 2 × P + 14 × P ÷ N |
| ZeRO-3 | Optimiser state + gradients + weights | FULL_SHARD | 16 × P ÷ N |
P is parameters, N is GPUs; activations and overhead come on top. The trade-off is communication: ZeRO-3 and FSDP full-shard gather each layer's weights in both the forward and backward pass, roughly 1.5× the traffic of DDP. In one machine that is usually fine. Across machines it is where fast networking becomes essential, which is covered in what distributed training is.
How much memory per GPU does each strategy need?
Worked example: full fine-tune of an 8B model, 16 bytes per parameter = 128 GB of model state.
| GPUs | DDP | ZeRO-2 / SHARD_GRAD_OP | ZeRO-3 / FULL_SHARD |
|---|---|---|---|
| 1 | 128 GB | 128 GB | 128 GB |
| 2 | 128 GB | 16 + 112 ÷ 2 = 72 GB | 64 GB |
| 4 | 128 GB | 16 + 112 ÷ 4 = 44 GB | 32 GB |
| 8 | 128 GB | 16 + 112 ÷ 8 = 30 GB | 16 GB |
Add a few GB to 15 GB of activations and overhead per GPU depending on sequence length. So an 8B full fine-tune fits on 4 × 80 GB cards with ZeRO-3 or FSDP, and on 8 × 48 GB L40S cards. The same table for every model size is in how much VRAM you need to fine-tune an LLM.
How much faster is training on more GPUs?
Inside one machine, DDP on a large enough batch typically reaches 85–95% scaling efficiency as a rule of thumb, so 8 GPUs give roughly 6.8–7.6× one GPU. Efficiency drops when:
- The model is small and steps are short, so communication is a bigger share of each step.
- The micro-batch is tiny, leaving little compute to hide communication behind.
- GPUs talk over PCIe through the CPU rather than over NVLink, especially with FSDP or ZeRO-3.
- Data loading cannot keep up with eight GPUs (a common, invisible bottleneck).
Cost is what scaling efficiency really changes. GPU-hours = single-GPU hours ÷ efficiency. Example: a full fine-tune of an 8B model on 1 billion tokens, estimated at about 50 GPU-hours on H100 PCIe (6 × 8×10⁹ × 10⁹ FLOPs at 756 TFLOPS dense BF16 and 35% utilisation).
| Setup | Assumed efficiency | Wall-clock hours | Billed GPU-hours | Price per GPU-hour | Cost |
|---|---|---|---|---|---|
| 4 × H100, FSDP | 90% | 50 ÷ (4 × 0.9) ≈ 13.9 | ≈ 55.6 | $4.99/hr | $277.44 |
| 8 × H100, FSDP | 85% | 50 ÷ (8 × 0.85) ≈ 7.4 | ≈ 58.8 | $4.99/hr | $293.41 |
| 8 × A100 80GB, FSDP | 85% | 122 ÷ 6.8 ≈ 17.9 | ≈ 143.6 | $3.79/hr | $544.24 |
Estimates, not measurements; prices as of November 2026. Doubling from 4 to 8 GPUs nearly halves the wall-clock time and adds only about 6% to the bill at these efficiencies. Poor scaling (say 60% on 8 GPUs) would bill about 83 GPU-hours instead of 55.6, half as much again, which is why you should measure throughput on a short pilot before committing a long run. On Wandering Giants Compute the machine price is simply the per-GPU price times the number of cards, so this comparison is the whole bill. A single H100 cannot run this job at all: 128 GB of model state does not fit in 80 GB.
How do you launch a multi-GPU training job?
The same Python script runs on one or many GPUs; the launcher starts one process per GPU and sets the environment variables (RANK, LOCAL_RANK, WORLD_SIZE) that PyTorch uses to find its peers. Hugging Face Trainer and TRL pick these up automatically.
# one GPU
python train.py
# DDP on all 4 GPUs in the machine, plain PyTorch launcher
torchrun --standalone --nproc_per_node=4 train.py
# the same with Hugging Face Accelerate
accelerate launch --multi_gpu --num_processes 4 --mixed_precision bf16 train.pyFor FSDP with Accelerate, write a config file once and pass it to the launcher. These keys match Accelerate 1.x; run accelerate config interactively if your version differs.
# fsdp.yaml
compute_environment: LOCAL_MACHINE
distributed_type: FSDP
mixed_precision: bf16
num_machines: 1
num_processes: 4
fsdp_config:
fsdp_sharding_strategy: FULL_SHARD
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
fsdp_transformer_layer_cls_to_wrap: LlamaDecoderLayer
fsdp_backward_prefetch: BACKWARD_PRE
fsdp_state_dict_type: SHARDED_STATE_DICT
fsdp_cpu_ram_efficient_loading: true
fsdp_sync_module_states: true
fsdp_use_orig_params: true
fsdp_offload_params: falseaccelerate launch --config_file fsdp.yaml train.pyFor DeepSpeed, a ZeRO-3 config with "auto" values lets the Hugging Face Trainer fill batch sizes and precision from its own arguments:
{
"bf16": {"enabled": "auto"},
"zero_optimization": {
"stage": 3,
"overlap_comm": true,
"contiguous_gradients": true,
"stage3_gather_16bit_weights_on_model_save": true
},
"gradient_accumulation_steps": "auto",
"gradient_clipping": "auto",
"train_batch_size": "auto",
"train_micro_batch_size_per_gpu": "auto"
}pip install deepspeed
deepspeed --num_gpus 4 train.py --deepspeed ds_zero3.json # if train.py parses HF TrainingArguments
# or set deepspeed="ds_zero3.json" in SFTConfig / TrainingArguments and use accelerate launch or torchrunThe full setup, including checks that every GPU can talk to every other, is in how to set up a multi-GPU ML environment.
What else changes in your training code?
Very little if you use Trainer, TRL or Axolotl. If you write your own loop, watch these:
- Effective batch size. Divide gradient accumulation by the GPU count to keep the same effective batch and learning rate.
- Logging and saving on rank 0 only. Otherwise eight processes write eight copies of every checkpoint.
- Data sampling. Use
DistributedSamplerso each GPU sees different data. - Random seeds. Seed per rank for data augmentation, identically for model initialisation.
- Checkpoint format. Sharded checkpoints (FSDP
SHARDED_STATE_DICT, DeepSpeed ZeRO-3) need consolidating before you use them on one GPU or serve them. device_map="auto". Remove it for DDP/FSDP; that option is for naive model parallelism in single-process inference, not distributed training.
What about interconnect: PCIe or NVLink?
GPUs in one machine exchange gradients and weight shards either over PCIe (often through the CPU's root complex) or over NVLink, NVIDIA's direct GPU-to-GPU link. NVLink is much faster, and NVIDIA's SXM systems connect all eight GPUs through NVSwitch. PCIe cards may have no NVLink, or NVLink bridges between pairs.
For LoRA and DDP the difference is usually small, because communication is modest and overlaps with compute. For FSDP full-shard or ZeRO-3 on large models it can matter a lot. Check what you have before you choose a strategy:
nvidia-smi topo -m
# NV# = NVLink, PIX/PXB = same PCIe switch, NODE = same CPU socket, SYS = across socketsIf the topology shows only PCIe, prefer DDP or ZeRO-2 where memory allows, and use larger micro-batches with gradient accumulation to give communication more compute to hide behind.
When renting from Wandering Giants fits
Wandering Giants Compute rents 1, 2, 4 or 8 of the same GPU in one machine, from RTX 4090 to B300, with root access for torchrun, Accelerate, FSDP and DeepSpeed. Billing is per minute, so a pilot run to measure scaling efficiency costs minutes, not a day's minimum. Run nvidia-smi topo -m after launch to see how the cards are connected, since interconnect varies by machine.
What we do not offer is multi-node: there is no cluster of machines joined by InfiniBand. If your job needs more than eight GPUs, or more memory than eight B300s provide, look at providers that sell multi-node clusters, such as Lambda's 1-Click Clusters, CoreWeave or Nebius. For a wider list of where to rent multi-card machines, see multi-GPU cloud servers.
Frequently asked questions
Does training on 2 GPUs make it twice as fast?
Close, but not quite. With DDP each step adds an all-reduce of the gradients, so 2 GPUs typically give 1.7–1.95× and 8 GPUs 6–7.5× in one machine, as a rule of thumb. Small models, slow interconnects and tiny batches scale worse.
Does multi-GPU training let me train bigger models?
Only with sharding. Plain DDP keeps a full copy of the model on every GPU. FSDP or DeepSpeed ZeRO-3 split weights, gradients and optimiser state across GPUs, so the model-related memory per GPU falls roughly in proportion to the GPU count.
Should I use FSDP or DeepSpeed?
Both work well inside Hugging Face Trainer, TRL and Axolotl. FSDP is native to PyTorch and needs no extra package; DeepSpeed offers mature CPU and NVMe offload and fine-grained ZeRO stages. Pick the one your framework's examples use and switch only if you hit a limit.
Do I need NVLink for multi-GPU training?
Not for most fine-tuning. DDP and LoRA communicate relatively little, and PCIe is enough. Full sharded training of large models moves far more data between GPUs and benefits from NVLink or NVSwitch. Check your topology with nvidia-smi topo -m.
Can I use multiple GPUs with QLoRA?
Yes. DDP with QLoRA is common: each GPU holds its own 4-bit copy and trains on different data. Sharding a QLoRA model with FSDP is supported in recent transformers, PEFT and bitsandbytes releases, but needs specific settings, so follow your framework's current docs.
Do I need to change my learning rate on more GPUs?
If your effective batch size grows, often yes. Keep the effective batch constant by reducing gradient accumulation as you add GPUs, and you can usually keep the same learning rate.
Rent the GPU for this, by the minute.
Launch 2, 4 or 8 of the same GPU in one machine with root access, run torchrun or accelerate, and pay by the minute.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is GPU Model Training? A Complete Guide
- GuideWhat Is Distributed Training and How Does It Work?
- TutorialHow to Set Up a Multi-GPU Machine Learning Environment
- GuideHow Much VRAM Do You Need to Fine-Tune an LLM?
- GuideWhat Is Multi-GPU Computing and When Do You Need It?
- ComparisonBest Cloud Providers for Multi-GPU Servers
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.