PipeFill: Using GPUs During Bubbles in Pipeline-parallel LLM Training

Daiyaan Arfeen, Zhen Zhang, Xinwei Fu, Gregory Ganger, Yida Wang

TL;DR

Scaling up large language model (LLM) training via pipeline parallelism introduces massive "pipeline bubbles"—idle GPU periods that can waste over 60% of cluster compute at scale. PipeFill repurposes these wasted intervals by dynamically context-switching to execute independent, pending batch workloads (like inference or smaller training tasks). By carefully partitioning workloads and guarding memory, PipeFill boosts overall GPU utilization by up to 63% at an 8,000-GPU scale while keeping main training job slowdown under 2%.

What Problem Does This Paper Address?

Distributed training of multi-billion-parameter LLMs typically requires combining tensor parallelism (TP), pipeline parallelism (PP), and data parallelism (DP). Because machine learning practitioners must keep the global minibatch size fixed to ensure proper convergence, scaling out across more GPUs with DP shrinks the number of microbatches per pipeline replica.

This creates a serious scaling bottleneck: pipeline bubbles. GPUs sit completely idle waiting for activations to propagate forward or gradients to flow backward. For standard synchronous pipeline schedules (such as GPipe or 1F1B), these bubbles routinely consume 15–30% of total GPU time and exceed 60% when scaled to thousands of devices. Prior mitigation strategies primarily re-executed redundant training passes or specific second-order optimizers (like K-FAC), which are only applicable to narrow training setups. PipeFill tackles the challenge of safely scheduling arbitrary, independent jobs into these transient idle windows without disrupting the multi-million-dollar primary training run.

Methods

PipeFill integrates three primary components into distributed training frameworks like DeepSpeed:

  1. Instrumented Pipeline Engine: PipeFill inserts explicit PipelineBubble instructions into the pipeline schedule. During an initial profiling phase, it probes bubble lengths via progressive delays and monitors free memory (torch.cuda.memory_allocated()). To expand available device memory for fill jobs, it asynchronously offloads the main job's Adam optimizer states to the CPU over dedicated CUDA streams during forward and gradient-synchronization passes.
  2. Fill Job Executor: A per-GPU worker process that receives an execution plan tailored to measured bubble constraints. It linearizes the computational graph of the fill job and uses a greedy bin-packing algorithm to partition operations into sub-graphs that fit into bubble windows. It uses PyTorch memory-capping primitives (cuda.set_per_process_memory_fraction) so that any unexpected fill-job memory spike causes an isolated out-of-memory error without crashing the main job.
  3. Fill Job Scheduler: Coordinates incoming cluster workloads with device-level bubble profiles. It supports user-definable scoring policies, such as Shortest-Job-First (SJF) to minimize job completion time (JCT) or Makespan-Minimizing policies for high-load cluster scenarios.
+----------------------------------------------------------------+
|                     Fill Job Scheduler                         |
|  (Dispatches independent batch inference / training jobs)     |
+----------------------------------------------------------------+
                               |
                               v
+----------------------- Device i Worker ------------------------+
|                                                                |
|  +------------------------------+   IPC    +----------------+  |
|  | Instrumented Pipeline Engine |--------->| Fill Job       |  |
|  | - Bubbles & memory profiling |  signals | Executor       |  |
|  | - Optimizer state offload    |          | - Bin-packs    |  |
|  | - Main LLM Execution         |          |   sub-graphs   |  |
|  +------------------------------+          | - Enforces mem |  |
|                                            |   caps         |  |
|                                            +----------------+  |
+----------------------------------------------------------------+

Datasets

The authors evaluated PipeFill using real traces and representative model distributions:

  • Fill-Job Workload Distribution: Synthesized from the Hugging Face Model Hub by filtering models uploaded in the previous year with over 100K downloads. The final benchmark selected five representative models under 3B parameters: EfficientNet (117M), BERT-base (109M), BERT-large (334M), Swin-large (779M), and XLM-RoBERTa-XL (2.8B).
  • Cluster Arrival Traces: Sourced from public Alibaba GPU cluster traces, filtered for non-latency-sensitive jobs.
  • Primary LLM Workloads:
  • Physical Cluster: A 5B-parameter LLM trained across 16 AWS EC2 p3.16xlarge instances (16 NVIDIA V100 GPUs, 16GB memory each).
  • Simulation: A 40B-parameter LLM training run simulated from 1,000 to 8,192 GPUs using 8-way TP and 16-way PP.

Key Insights and Ideas

  • Safe Bubble-Filling Threshold: Physical experiments revealed that filling up to 68% of the bubble duration achieves high utilization while keeping primary job slowdown strictly <2%. Attempting to fill beyond this threshold rapidly degrades the main job's training speed.
  • Batch Inference Outperforms Training as Fill Work: Inference jobs require significantly less memory (no activation storage or optimizer states). This allows them to run larger batch sizes within the bubble's constrained free memory (typically ~4.5 GB), achieving far higher FLOPS utilization than training fill jobs, which frequently stall on CPU offloading.
  • Diminishing Returns on Bubble Memory: Increasing available bubble memory from 2 GB to 4 GB boosted recovered TFLOPS by 30%, but moving from 4 GB to 8 GB yielded only an additional 12.2% gain. Bubble duration and context-switch boundaries, rather than raw memory, quickly become the primary performance bottleneck.

Key Results

  • Cluster Utilization at Scale: On an 8,192-GPU simulation of a 40B-parameter LLM, PipeFill increased overall GPU utilization by >45% with a realistic trace mix, and by 63% when filling with batch BERT inference. At 8K GPUs, this 63% increase is equivalent to reclaiming up to 2,600 GPUs of compute.
  • Mitigating Scaling Penalties: When scaling from 2K to 6K GPUs, traditional pipeline-parallel training suffers a 40% drop in GPU efficiency; PipeFill limits that utilization drop to <23%.
  • Fidelity of System Simulation: Profile-based simulation aligned with physical cluster execution within a <2% error for recovered FLOPS and within 5% for overall TFLOPS at equivalent bubble ratios.

Limitations and Future Work

  • Incompatible with Latency-Sensitive Tasks: Because execution is paused the moment a bubble ends, PipeFill cannot support real-time or online inference with tight service-level objectives (SLOs).
  • Execution Inefficiencies for Fill Jobs: Fill workloads experience noticeable execution slowdown (~30% efficiency of bare-metal execution) due to cold GPU caches, frequent context interruptions, and CPU-offloading bottlenecks.
  • Non-Contiguous Bubbles: PipeFill focuses only on major contiguous bubbles (fill-drain and forward-backward gaps). Interleaved schedules (such as interleaved 1F1B) feature smaller, fragmented bubbles that PipeFill does not fill, reducing its recovered TFLOPS by 10–30%.
  • Future Hardware Opportunities: The authors note that emerging architectures with unified or higher-bandwidth CPU-GPU interconnects (e.g., NVLink-C2C, PCIe Gen 5) could substantially diminish CPU-offloading penalties for larger fill jobs.

Summary updated

BibTeX
@inproceedings{arfeen2025pipefill,
  author = {Daiyaan Arfeen and Zhen Zhang and Xinwei Fu and Gregory Ganger and Yida Wang},
  title = {{PipeFill: Using GPUs During Bubbles in Pipeline-parallel LLM Training}},
  booktitle = {MLSys},
  year = {2025},
  url = {https://openreview.net/forum?id=650J0YFjnV},
}
Figure