Compare tensor, pipeline and expert parallelism for inference serving.
Compare tensor parallelism, pipeline parallelism, and expert parallelism along three axes: what they shard, their inter-GPU communication pattern per token, and what they cost in TTFT vs throughput. For each, state when you would deploy it.
Tensor parallel shards each matmul and cuts latency but needs NVLink; pipeline parallel splits layer ranges for throughput with a bubble tax; expert parallel routes mixture-of-experts experts and lives on load balance.
Imagine a kitchen too big for one cook, so you split the work three ways. The first way: several cooks chop the same vegetable together, then compare piles every few seconds. They finish fast, but only if they stand close enough to pass bowls instantly. The second way is an assembly line: one cook preps, the next fries, the next plates. The line hums once it fills, but the first plate is slow because each station waits for the one before it. The third way is a food court where different stalls make different dishes, and a host sends each order to the right stall. It works great until everyone wants pizza, so one stall is swamped while the rest sit idle. Real kitchens mix all three to keep every cook busy.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: name the three sharding axes, give each one's per-token communication pattern, contrast latency vs throughput vs balance, then state deployment fit and the production 3-D combinations.
| Strategy | Shards what | Communication per token | Latency vs throughput | Deploy when |
|---|---|---|---|---|
| Tensor parallel | Each matmul (head or feature dim) | All-reduce every layer (heavy) | Lowest latency; caps near TP=8 | Latency-sensitive serving inside an NVLink node |
| Pipeline parallel | Contiguous layer ranges | Activation handoff at stage boundary (light) | High throughput; bubble hurts TTFT | Batch or offline, or the outer axis across nodes |
| Expert parallel | MoE experts across GPUs | All-to-all dispatch by routing | Fits MoE; load balance sets the ceiling | Any mixture-of-experts model |
Real products, models, and research that use this idea.
- DeepSeek V4 serves its mixture-of-experts model with combined tensor and expert parallelism, using expert-parallel all-to-all dispatch across GPUs.
- vLLM and SGLang both expose tensor-parallel size and pipeline-parallel size as deployment flags, defaulting to tensor parallel within an NVLink node.
- NVIDIA TensorRT-LLM ships tensor plus pipeline parallel for dense Llama 3.1 70B on NVLinked H100 and B200 clusters.
- Mistral Large 3 and other MoE models rely on expert parallelism because the full expert set exceeds a single GPU's HBM.
- Megatron-LM established the 3-D parallel recipe (tensor inside node, pipeline across nodes, data outermost) that production serving stacks still follow in 2026.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does tensor parallelism cap out around TP=8 even with NVLink?
QDerive the pipeline bubble fraction and explain how to shrink it.
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating the three as interchangeable speedups. They optimize different things: tensor parallel trades bandwidth for latency, pipeline parallel trades a startup bubble for throughput, and expert parallel trades balance to fit experts in memory.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.