aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 17. Distributed ML
Lesson 2 of 7 9 min · 156 words

Data and model parallelism

Splitting the data versus splitting the network.

Data parallelism: every worker holds a full copy of the model and processes a different slice of each mini-batch. Each computes gradients on its slice; the gradients are averaged, , and every copy applies the same update. It is the most common approach and scales well while the model fits on one device.

Model parallelism: the model itself is split across devices because it is too large for one. Tensor parallelism splits individual layers (parts of each weight matrix on different GPUs); pipeline parallelism puts different layers on different GPUs and streams micro-batches through them like an assembly line.

Large models combine all three ("3-D parallelism"), plus techniques like ZeRO / fully sharded data parallel that split optimiser state and parameters across workers.

Formula to remember

Data-parallel gradient

Each worker computes a gradient on its shard; results are averaged.

Quick check · +5 XP

Splitting one large network across several GPUs is…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser