Distributed training

Wiki chapters and blog posts about Distributed training.

Wiki

Mixture of Experts (MoE): Routing, Load Balancing and Sparse Activation

A mixture-of-experts layer swaps the feed-forward network for many experts and routes each token to only k of them, so total parameters grow while per-token compute stays small. This page computes total and active parameters for Mixtral and DeepSeek-V3 and lets you try load balancing.

Intermediate 31 min read

Distributed Training: Data, Tensor and Pipeline Parallelism

Data parallelism splits the batch, tensor parallelism the matrices inside a layer, pipeline parallelism the stack of layers; ZeRO and FSDP shard optimizer state, gradients and parameters. Runnable checks verify gradient averaging, ring all-reduce traffic, the Megatron split and the bubble formula.

Advanced 42 min read

Collective Communication: Why All-Reduce Has So Many Algorithms

Collective communication is the plumbing of multi-GPU training. This page simulates five all-reduce algorithms and checks them element by element, compares rounds and traffic with the alpha-beta model, then shows how topology, summation order and MoE all-to-all change the choice.

Advanced 48 min read

Blog posts

Topics