Skip to main content

Distributed training

When one GPU is not enough, scale with data parallel, sharded optimisers or model parallel techniques.

Adapted for this playbook from the 🤗 Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/accelerate. Images © Hugging Face (documentation-images) unless noted. This is not a substitute for the upstream docs — verify against the current version.

Covers Hugging Face pages: accelerate, accelerator_selection, ddp, fsdp, deepspeed, deepspeed_alst, tensor_parallelism, debugging, perf_train_gpu_many

Options (overview)​

MethodSummary
AccelerateUnified launcher / device helpers
DDPClassic data parallel
FSDP2Shard parameters/gradients/optimiser states
DeepSpeed ZeROMemory-efficient sharded training
Tensor parallelismSplit layers across GPUs
Ulysses SPSequence parallelism for long context

Start from Accelerate and Parallelism methods.

Debugging​

Distributed failures are often NCCL, topology or batch-size issues. Use Hugging Face’s Debugging notes and keep a single-GPU baseline.

Discussion

Comments​

Share feedback or questions about this page. No account required.

Loading comments…