Zero Bubble Pipeline Parallelism for Neural Network Training

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Pipeline parallelism in large-scale distributed training of neural networks faces inefficiencies due to pipeline bubbles, which are idle times caused by dependencies between layers, leading to increased device idle time and peak memory demands.

Innovation Solution

The method involves performing multiple forward and backward passes through the neural network model, splitting backward passes into gradient computation passes and parameters computation passes, and determining pipeline bubbles to perform parameters computation passes during these idle times, utilizing a heuristic algorithm to optimize the scheduling of these passes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If pipeline parallelism is used for large-scale distributed training, then model training capability is improved, but device idle time increases due to pipeline bubbles

Engineering Contradiction:
Improvemodel training capabilityVSAvoiddevice idle time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The backward pass is segmented into two independent parts: gradient computation pass (B) and parameters computation pass (W). This segmentation allows different stages of the pipeline to execute different passes concurrently, filling the idle time bubbles that previously existed between forward and backward passes in pipeline parallelism.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

By splitting the backward pass into B and W passes, the patent enables continuous utilization of computing resources. While some stages perform gradient computation, other stages simultaneously perform parameters computation, eliminating the idle periods and maintaining continuous useful action across all pipeline stages.

Inventive Principle:
Principle #20Continuity of useful action

2Productivity

If the number of concurrent batches in the pipeline is increased to reduce bubble ratio, then pipeline efficiency is improved, but peak memory demands increase

Engineering Contradiction:
Improvepipeline efficiencyVSAvoidpeak memory demands
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

Segmenting the backward pass enables memory optimization by allowing gradient computations and parameters computations to occur in separate phases with different memory requirements, reducing the peak memory demand compared to holding all batch data in memory simultaneously.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent discards intermediate activations after the gradient computation pass completes, recovering memory space before the parameters computation pass begins. This approach reduces peak memory usage while maintaining pipeline efficiency through the coordinated execution of B and W passes.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS20250111234A1Method and device for training a neural network model utilizing zero bubble pipeline parallelism
Publication Date: 2025.04.03 SHOPEE IP SINGAPORE PTE LTD
  • US20250111234A1 patent drawing
  • US20250111234A1 patent drawing
  • US20250111234A1 patent drawing

AI summary

Various embodiments concern a computer-implemented method for training a neural network model utilizing zero bubble pipeline parallelism, the computer-implemented method including: performing a plurality of forward passes through the neural network model, wherein each forward pass of the plurality of forward passes transforms a corresponding input x to a corresponding output y; performing a plurality of backward passes through the neural network model, wherein the plurality backward passes are split into a plurality of gradient computation passes B and a plurality of parameters computation passes W; performing a plurality of gradient computation passes B for the corresponding input x and the corresponding output y; and determining pipeline bubbles and performing the plurality of parameters computation passes W during the pipeline bubbles.