Pipeline parallelism splits a model into sequential stages placed on different devices, then divides each input batch into microbatches. Different stages process different microbatches at the same time, reducing the idle time found in basic model parallelism. section 16.5.1
Figure 16.7 Pipeline parallelism with three microbatches involves processing each microbatch and then communicating it to the next device, as indicated by the arrows. This approach enables concurrent processing across devices.
The three-device diagram shows microbatches moving between stages while computation overlaps across devices. section 16.5.1
A practical pipeline setup involves these decisions:
- Split the model at suitable layer boundaries and assign each stage to a device. section 16.5.1
- Choose microbatches so stages can work concurrently rather than waiting for the entire batch. section 16.5.1
- Balance stage workloads carefully; uneven computation creates bottlenecks and stragglers. section 16.5.1
- Use torch.distributed.pipelining utilities to define split points, build stages, and execute a schedule. section 16.5.1
- Prefer it for skinnier, deeper models; wider, shallower models or layers too large for one device favor tensor parallelism. section 16.5.3
Defining and running a pipeline
A PyTorch model can mark split points with a split_spec attribute, such as placing SplitPoint.BEGINNING before successive layers. The pipeline is then built from a sample microbatch, a stage is assigned by rank, and the schedule is stepped differently on the first, middle, and final ranks. section 16.5.1



