Skip to content
StackDecode
System Design
19. AI System Design and LLM InfrastructureAnimated

Data Parallelism

Same model on each device, different data.

The idea

Each device processes a slice of the batch and gradients are averaged.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Dataset in obje…Data loaderGPU node 1GPU node 2Checkpoints
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Stream shards of data to every GPU worker.

step:
1/4
at:
Dataset in object storage
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Copy the model to every device
  2. 2Split the batch
  3. 3Compute gradients locally
  4. 4Average gradients and update

Where it is used

Most training.

Watch out for

The model must fit on one device.

Related