Machine Learning Engineering · Module 17
Distributed training and scalable ML systems
- Lessons
- 11
- Free
- 0
- Reading
- ~3 h
Your progress
0 / 11 lessons done
Sign in to trackLessons
- Why train across many machinesBefore a team rents 40 GPUs, someone has to show why one is not enough, and which limit the extra GPUs remove. Two short estimates, memory and time, answer that and point to the right kind of split.
- Data parallel training: same model, many GPUsData parallel training is the first tool teams reach for when a model trains too slowly on one GPU, and it sits underneath most larger setups. Knowing what it exchanges and what it assumes tells you when adding GPUs will help and when it won’t.
- Model, pipeline and expert parallel trainingData parallelism stops working once one copy of the model no longer fits on a GPU, or costs more to keep in sync than to compute. Recommenders hit this first, through their embedding tables, and large transformers soon after.
- Sharded training: ZeRO and FSDPA model that trains fine on one GPU can stop fitting once you add Adam, and adding GPUs with plain data parallel does not help. Sharding is the standard fix in PyTorch, and knowing its memory and traffic arithmetic tells you which setting to pick before you rent the cluster.
- Communication costs in distributed trainingAdding GPUs only speeds up training while the GPUs can agree on a gradient faster than they compute one. A few lines of arithmetic tell you, before you rent the cluster, whether the network or the model will set the pace.
- Fault tolerance and checkpoints at scaleAny job that trains on many GPUs at once stops when one of them fails, and the bigger the job, the more often that happens. Checkpoints sized and timed for the cluster turn a lost night into a few lost minutes.
- Feeding the GPUs: data loading at scaleWhen a training job on many GPUs runs slower than its plan, the cause is often the data loader, not the model or the network. Knowing what the loader must deliver, and how to check it, saves GPU-hours that would otherwise be spent waiting.
- Sharing GPU clusters across ML teamsOnce more than one team trains models, GPUs become a shared budget. Queues, quotas and preemption decide whether the deadline job finishes on time and whether the rest of the week’s GPU-hours are used or wasted.
- Real-time ML systems: latency budgets end to endA model that scores in 10 ms can still sit inside a page that misses its 100 ms deadline. Most real-time ML incidents are lost milliseconds between the stages, and the fix is a budget that each stage owner can measure and keep.
- Case: Meta’s ads model trained on thousands of GPUsFew teams train on thousands of GPUs, but every team that grows past one machine meets the same questions Meta answers here: how to split the model, how to keep each GPU busy, and how to make one expensive model pay for itself.
- Design: training infrastructure for a growing teamEvery lesson in this module solved one job’s problem. Once several teams train on the same machines and their models keep growing, those answers become shared decisions: what to buy, how jobs ask for GPUs, where checkpoints go and what happens when a machine dies at 3 am.
Practise with
No tools or paper guides for this module yet.
Terms this module teaches 1
Open glossaryShowback
Reporting to each team what its share of a shared resource cost, without moving the money between budgets.