Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Models and algorithms

3D Parallel Training

About 3736 characters Updated Nov 30, 2026 23 views AI wiki

3D parallel training is an engineering method that combines data parallelism, tensor parallelism and pipeline parallelism to train very large models. It solves the basic contradiction that a single GPU can neither hold the model nor run the training, and is the standard architecture for training hundred-billion-parameter models.

Core Principles

Data parallelism assigns different batches to different devices and performs an all-reduce on gradients at the end of each step; the communication volume grows linearly with model scale, so it suits models of modest size. Tensor parallelism splits a single matrix multiplication by columns or rows across multiple GPUs; each layer needs two all-reduces, communication is frequent, so it is only suitable on high-speed interconnects within the same node. Pipeline parallelism cuts the model into segments by layer and places them on different devices, advancing with micro-batches; devices pass only activations, so communication is small but there is idle bubble time.

The product of the three is the total degree of parallelism. Frameworks represented by Megatron and DeepSpeed schedule all three together: a typical hundred-billion model sets a data-parallel degree of several, tensor parallelism of eight, pipeline parallelism of sixteen, plus expert parallelism and sequence parallelism. Megatron focuses on efficient implementations of tensor and pipeline parallelism, while DeepSpeed's ZeRO series reduces per-GPU memory by sharding optimizer states, gradients and parameters; ZeRO's three stages can be seen as a deepening of data parallelism along the memory dimension.

Key Points

First, parallel dimensions must match the hardware topology. Tensor parallelism inside a node, pipeline parallelism across nodes, data parallelism at the outermost layer: this is the common principle. Second, the pipeline bubble rate depends on the ratio of micro-batches to pipeline stages; more micro-batches mean smaller bubbles but more activation memory, often mitigated by interleaving one forward and one backward pass. Third, recomputation, mixed precision and activation sharding are often used together with 3D parallelism and jointly determine the memory budget. Fourth, training throughput should be measured by model FLOPs utilization; the parameter search space is large and relies on a combination of experience and profiling.

Common Misconceptions

Misconception one: thinking higher parallelism is faster. Communication overhead eats the gains, and beyond a certain scale the speedup drops markedly. Misconception two: placing tensor parallelism across nodes, where insufficient network bandwidth causes severe blocking. Misconception three: ignoring load balance, since uneven layer counts in pipeline stages make one segment the bottleneck.

Application Scenarios

Hundred-billion-parameter pretraining, long-context model training, multimodal large model training, mixture-of-experts model training, and large-scale fine-tuning tasks.

Choosing a parallel strategy is essentially a trade-off between communication and memory. Data parallelism has the largest communication volume but the simplest implementation, suitable when the model fits on a single GPU; tensor parallelism has the densest communication and depends on ultra-high-speed interconnects, usually limited to eight GPUs within one machine; pipeline parallelism has small communication and can scale across data-center levels, but introduces pipeline bubbles that must be amortized with enough micro-batches. The combination is not unique; a common industry practice is to first fix the tensor-parallel degree one machine can sustain, then extend across machines with pipeline parallelism, and finally fill the remaining devices with data parallelism.

There are also two important additional dimensions: sequence parallelism, used to spread the activation memory of long sequences, and expert parallelism, used in mixture-of-experts models to place different experts on different devices. Truly large-scale training is often 3D plus these two dimensions, that is, five-dimensional parallelism. At the framework level, Megatron-LM provides proven tensor and pipeline implementations, while DeepSpeed provides ZeRO sharding and inference offloading; the two are often borrowed from and mixed with each other in the community.