internalsGet Pro

Module 17 · Lesson 2 of 11Pro

Data parallel training: same model, many GPUs

Level
Intermediate
Topic
Distributed training and scalable ML systems
Reading time
17 min

When you finish this page you can

  1. Trace one data parallel training step, from splitting the batch to the all-reduce of gradients and the optimizer step.
  2. Explain why every replica stays identical without ever sending its weights.
  3. Work out the effective batch size, step time and run time of a data parallel job, and adjust the learning rate for the bigger batch.
  4. Set up PyTorch DistributedDataParallel and check its result against one process: same start, same data split, same averaged gradient.

Builds on 3 lessons

Start with lesson 116 min
  1. Why train across many machines16 min
  2. Stochastic and mini-batch gradient descent17 min
  3. Batch size, memory and training speed17 min

Video lesson · coming soon

A nightly retrain that would take 154 hours

is an online store with 5 million customers a day and 20 million products. Its home page shows each customer products picked by a sequence model. The model reads a customer’s last 200 events and predicts what they want next. Joseph, who leads the growth team, wants it retrained every night on a year of events, inside a 6-hour overnight window.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan