Sixth GPU Deep Dive post, closing a thread the Mixture of Experts post left open on purpose: "serving an MoE model efficiently requires shuffling token activations between GPUs mid-layer... a genuinely different bottleneck than anything the GPU section of this blog has covered so far." Every GPU Deep Dive post before this one — FlashAttention, FP8 in WGMMA, PagedAttention, speculative decoding, continuous batching — is about something happening inside one GPU, or inside one node's memory. Expert parallelism is the first one where the bottleneck is the network between GPUs.
Why you can't just replicate every expert everywhere
The obvious way to run an MoE layer on multiple GPUs is the same trick every other layer uses: copy the whole thing onto every GPU (data parallelism) and let each GPU process different tokens independently. That falls apart for MoE specifically because of what makes MoE worth using in the first place — the whole point, as the MoE post covered, is that total parameter count can be huge (671B for DeepSeek-V3) while only a small slice is active per token (37B). Replicating all 671B worth of experts onto every single GPU defeats that: you'd be paying the full memory cost of the big model on every device while still only using a sliver of it per token.
Expert parallelism instead shards the experts themselves: each GPU holds a subset of the experts (sometimes just one), the way tensor parallelism shards one giant matrix and data parallelism replicates the whole model. A 256-expert MoE layer running across 8 GPUs might put 32 experts on each one. The catch: a token's hidden state is computed on whatever GPU is handling its position in the batch, but its router might pick an expert that lives on a completely different GPU.
Dispatch, compute, combine
GShard (Lepikhin et al., 2020) is the paper that worked out how to make this practical, scaling a sparsely-gated MoE Transformer past 600 billion parameters across 2048 TPU v3 cores, training a 100-language-to-English translation model in 4 days. Its solution has three steps, run for every MoE layer, every forward pass:
- Dispatch: an all-to-all communication step where every GPU sends each of its local tokens' hidden states to whichever GPU holds that token's chosen expert.
- Compute: each GPU runs its resident expert(s) on whatever tokens just arrived, entirely locally — this part is identical to the single-GPU MoE computation from the previous post.
- Combine: a second all-to-all step sending each token's result back to the GPU that originally held it, so the rest of the layer (attention, layer norm, the next layer) can continue as normal.
This is a structurally different kind of communication from what multi-GPU training usually does. Data parallelism's gradient sync and tensor parallelism's activation sync are both all-reduce operations — combining the same quantity across devices. Dispatch and Combine are all-to-all — every device potentially sends a different, token-dependent amount of data to every other device, and which GPU needs what isn't known until the router has already run.
The bandwidth cliff
Expert parallelism's cost is dominated by one fact: bandwidth inside a node is far higher than bandwidth between nodes. NVLink connects GPUs within the same node at roughly 200 GB/s; InfiniBand, connecting separate nodes, tops out around 50 GB/s — about a 4x drop. Every token whose chosen expert happens to live on a different node pays that drop, and with hundreds of fine-grained experts spread across many nodes, most tokens' assigned experts simply aren't local.
Left unoptimized, this gets expensive fast: a recent technical report on scaling MoE training notes that in architectures like DeepSeek-V3, where experts span multiple nodes, unoptimized all-to-all can consume up to 60% of total training time — more time spent moving activations between GPUs than actually computing anything on them.
How DeepSeek-V3 cuts this down
DeepSeek-V3's infrastructure (described in its technical report) attacks this from a few directions at once:
- Node-limited routing: cap each token's experts to live on at most 4 nodes, rather than letting the router scatter a single token's choices arbitrarily across the whole cluster — this bounds the worst case instead of leaving it to chance.
- Deduplicating cross-node traffic: if multiple tokens on one node are headed to experts on the same remote node, send that data over InfiniBand once, then fan it back out to the right GPUs locally over NVLink, rather than paying the slow inter-node link separately for every token.
- DualPipe scheduling: overlap the Dispatch/Combine communication for one micro-batch with useful compute from another, so the GPU isn't simply idle while waiting on the network. With this in place, DeepSeek reports near-zero all-to-all overhead rather than the 60% worst case above.
One more job for expert capacity
The MoE post covered expert capacity as a training-stability fix — a hard cap on how many tokens any expert processes per batch, with overflow tokens skipped via the residual connection. In a distributed setting it does double duty: the Dispatch step needs to allocate a fixed-size communication buffer for each expert before it knows exactly how many tokens will actually arrive, since all-to-all buffer sizes have to be set ahead of time. Capacity isn't just protecting training dynamics anymore — it's setting the size of a real network buffer.
Same shape of problem, familiar from elsewhere on this blog
This is worth putting next to continuous batching: both are, underneath, scheduling problems about keeping compute busy while work of uneven, unpredictable shape arrives. Continuous batching's unit of unpredictability is how long a sequence will run; expert parallelism's is which GPU a given token's work needs to land on. Different axis, same underlying lesson this blog keeps landing on: once a model is sparse or variable in any dimension, somebody has to build real infrastructure to keep the hardware from sitting idle waiting for the right piece of work to show up in the right place.
References
- GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding — Lepikhin et al. (2020)
- DeepSeek-V3 Technical Report (2024)
- Scalable Training of Mixture-of-Experts Models with Megatron Core — Technical Report
Dispatch/Combine diagram above is original artwork made for this post.