What is Pipeline parallelism?
Splitting a model's layers across GPUs in sequence, streaming micro-batches to reduce the time GPUs sit idle (the bubble).
Japanese name: パイプライン並列
Splitting a model's layers across GPUs in sequence, streaming micro-batches to reduce the time GPUs sit idle (the bubble).
Japanese name: パイプライン並列
The layers of the model are cut in order from the front into several groups. Each group is called a stage and is assigned to one GPU. In the forward pass, the output of one GPU is sent to the next. In the backward pass, gradients are sent in the opposite direction. What each GPU holds is the weights of its own stage. A large model that does not fit on one GPU can therefore be trained. What passes between GPUs is the data at the stage boundaries.
If a batch is sent through as a whole, the other GPUs wait while one is computing. The batch is therefore split into small micro-batches that are sent through one after another. Even so, waiting time remains at the start and the end, and it is called the bubble. Take the forward pass alone in a simple form, with 8 micro-batches flowing through 4 stages and each stage handling one micro-batch per time slot. The whole takes 8 + 4 − 1 = 11 slots, and each GPU works for 8 of them. It waits for 3 slots, a share of 3 ÷ 11, about 27%. With 32 micro-batches the share falls to 3 ÷ 35, about 9%.
The more micro-batches there are, the smaller the share of the bubble. If each one becomes too small, however, the GPUs cannot be used efficiently. Gradients are added up over the micro-batches, and the weights are updated once the whole batch is complete. As long as no layer uses statistics of the whole batch, the update therefore uses mathematically the same gradient as when the batch is computed without splitting. It is desirable for the stages to take about the same time, because a heavy stage holds up the flow. In practice it is used together with data parallelism and tensor parallelism.
Answer: B. To reduce the idle time (bubble) in which later GPUs wait for earlier ones, keeping several GPUs busy at once
If a whole batch flows through at once, while the first GPU computes, the second and later GPUs can do nothing but wait. Splitting the batch into micro-batches lets the second GPU compute micro-batch 1 while the first computes micro-batch 2, and so on, overlapping the work. Some waiting (the bubble) remains at the start and end, so the number of micro-batches is made large enough.
The idea is similar. Both divide the work into stages and send several pieces of data through, each slightly behind the last. What flows is micro-batches rather than instructions, however, and there is also a reverse flow for backpropagation.
Not in the basic scheme. At the start the later GPUs have no data to process, and at the end the earlier GPUs have none. The number of micro-batches is increased to make its share of the whole smaller.
Pipeline parallelism appears in 2 practice questions across 1 topic, including AI Hardware & Software Stack.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.