Modern models and datasets routinely outgrow a single GPU: training can take days, or the model simply will not fit in one device's memory, and distributed training exists to spread that work across many GPUs and machines so it finishes in hours and scales beyond any single accelerator. The dominant approach, data parallelism, replicates the model on each GPU, feeds each a different slice of the batch, and synchronises gradients so all replicas stay identical. PyTorch's DistributedDataParallel and Uber's Horovod are the two standard implementations, both built on efficient collective communication. The problem they solve is concrete: naive single-GPU training caps your throughput at one device, and crude approaches like parameter servers bottleneck on a central node. DDP and Horovod instead use all-reduce, a decentralised pattern where every GPU contributes and receives the averaged gradient, scaling near-linearly with hardware. Understanding distributed training is essential because at any serious scale, the question is not whether to distribute but how to do so without communication overhead erasing the speedup.
35 minadvanced
Distributed Training: Horovod and PyTorch DDP
Analogy🏏Cricket
🏏 Think of it like cricket: imagine a batting coach analysing why Virat Kohli scored freely in one innings but struggled in another, yet kept no notes on which bat, which guard, or which net drills preceded each. Just as a detailed training diary logging bat weight, stance, and bowling type lets the coach link inputs to outputs, MLflow logs hyperparameters and data to outcomes. Just as comparing diary entries reveals that a heavier bat hurt timing, comparing tracked runs reveals which learning rate lifted accuracy. Just as a shared diary lets the whole support staff learn from one session, a shared tracking server lets the whole team learn from every run. The insight is that improvement is impossible without recorded cause and effect; tracking is what converts trial and error into knowledge.
Lesson 9 of 35
0% complete