← All questions
Inference & ServingMedium· Pipeline Parallelism· Model Training· Efficiency

Explain the pipeline bubble and how you would reduce it.

The bubble arises because during startup, later stages idle while device 0 fills them; during teardown, earlier stages idle while the last stage drains. The fraction of time lost is (p-1)/m, where p is the number of pipeline stages and m is the number of micro-batches. To reduce this, one can increase m or use 1F1B scheduling, which bounds activation memory at p live tensors regardless of m. For example, with p=8 and m=32, the bubble is approximately 22%.

Code playground (Python)