---
title: "Compare data parallelism, FSDP/ZeRO, tensor parallelism and pipeline parallelism: what is split, what is communicated…"
url: https://gurkanozkan.ai/learn/questions/mle-data-tensor-pipeline-parallelism-and-sharding-55/
markdown: https://gurkanozkan.ai/learn/questions/mle-data-tensor-pipeline-parallelism-and-sharding-55.md
kind: question
role: ML engineering
stage: Technical
difficulty: Hard
json: https://gurkanozkan.ai/api/learn/questions/mle-data-tensor-pipeline-parallelism-and-sharding-55.json
robots: noindex
---

# Compare data parallelism, FSDP/ZeRO, tensor parallelism and pipeline parallelism: what is split, what is communicated, and when to combine them.

ML engineering · Technical · Hard

## Answer

*Model answer, written in a candidate's voice*

### In short

- DP: replicate model, split batch, all-reduce gradients each step.
- ZeRO/FSDP: shard optimiser state, gradients and parameters; all-gather params and reduce-scatter gradients.
- TP: split matrices/activations inside layers; frequent intra-layer communication, needs high-bandwidth interconnect.
- PP: split layers into stages; communicate boundary activations/gradients; bubbles reduced by micro-batching.
- Combine for very large models: TP inside node, PP across nodes, DP/FSDP across replicas; trade memory savings against communication and bubbles.

### In full

The core distinction is what is partitioned and how often devices talk. Data parallelism replicates the full model and splits the batch, so each step needs a gradient all-reduce across replicas; it is simple and efficient when the model fits comfortably. ZeRO/FSDP instead shards optimiser state, gradients and often parameters across data-parallel ranks, using all-gathers for parameters and reduce-scatters for gradients, which saves memory at the cost of extra communication. Tensor parallelism splits individual matrices and activations within a layer, so it communicates frequently and is best kept on high-bandwidth interconnects such as NVLink within a node. Pipeline parallelism splits layers into stages across devices, communicating only at stage boundaries, but it introduces pipeline bubbles that micro-batching and enough in-flight micro-batches are used to reduce. For very large models I would combine them: TP inside a node, PP across nodes for layer-level scaling, and DP or FSDP across replicas, choosing the mix by memory pressure versus interconnect bandwidth and by how much pipeline bubble and communication overhead I can tolerate.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- DP replicates the model and all-reduces gradients.
- ZeRO/FSDP shard optimiser state, gradients and parameters, with all-gather/reduce-scatter.
- TP splits matrices within layers (high-bandwidth interconnect needed); PP splits layers into stages (bubbles, micro-batching).
- 3D parallelism for very large models, with communication vs memory trade-offs.

## Common mistakes

- putting tensor parallelism across slow inter-node links
- ignoring pipeline bubbles.

## Topic guides

- [Distributed training and parallelism](https://gurkanozkan.ai/learn/topics/distributed-training.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
