Abstract
Training Large Language Models (LLMs) with massive context windows is often bottlenecked by memory limits and slow inter-node communication. This paper introduces InfiniPipe, a system featuring Elastic Pipeline Parallelism (EPP). EPP is a "data-centric" approach that adaptively switches between token-level and batch-level parallelism based on sequence length. By co-optimizing pipeline scheduling with a novel adaptive checkpointing strategy, InfiniPipe achieves up to a 1.69× speedup over state-of-the-art systems like FlexSP.
Introduction: The Long-Context Bottleneck
As LLMs move toward "infinite" context (128K tokens and beyond), standard distributed training strategies face significant hurdles. Sequence Parallelism (SP) is effective for long contexts but incurs heavy inter-node communication overhead. Pipeline Parallelism (PP) reduces communication but faces a granularity dilemma: batch-level PP causes Out-of-Memory (OOM) errors on long sequences, while token-level PP often underutilizes GPUs due to small compute chunks.
Furthermore, real-world datasets exhibit extreme skew. As shown in Figure 1, while short sequences dominate the sample count, the rare extremely long sequences account for a disproportionate share of the total computation (FLOPs). Static training schedules fail to handle this variance, leading to significant pipeline "bubbles" or idle time. The authors argue that Pipeline Parallelism is the superior choice for inter-node communication due to its negligible overhead, while Sequence Parallelism should be reserved for high-speed intra-node links.
Methods: Elastic Pipeline Parallelism
InfiniPipe addresses these challenges through three core innovations centered around Elastic Pipeline Parallelism (EPP).
1. Elastic Pipeline Parallelism (EPP)
Instead of a fixed granularity, EPP orchestrates a hybrid of token-level and batch-level PP. It adaptively determines the optimal granularity for each micro-batch based on hardware resources and input sequence length. Figure 2 illustrates how EPP's dynamic scheduling fills the bubbles left by static schedules, significantly improving GPU utilization and managing peak memory usage to avoid OOM errors.
2. Workload-Balanced Sequence Processor
To manage data heterogeneity, InfiniPipe employs a "split and pack" strategy. It shards excessively long sequences into manageable slices (token-level) and packs multiple short sequences together (batch-level). This ensures that every GPU is consistently assigned high-intensity work, regardless of the original sequence distribution.
3. Stage-Aware Adaptive Checkpointing
Standard gradient checkpointing is typically applied uniformly. InfiniPipe uses a Mixed-Integer Linear Programming (MILP) solver to decide which layers of which chunks should be checkpointed at the chunk level. This allows the system to minimize recomputation time while keeping the memory footprint just below hardware limits, effectively "squeezing" more data into memory-constrained stages.
Key Results and Performance
Evaluations on a 32-GPU cluster using CommonCrawl and GitHub datasets demonstrate InfiniPipe's efficiency:
- Throughput Gains: InfiniPipe achieved a 1.69× speedup over FlexSP, 2.07× over DeepSpeed, and 2.60× over Megatron-LM for a 13B model.
- Scalability: The system maintained superior throughput as context length increased to 192K, whereas baseline methods suffered from increasing workload imbalance.
- Efficiency: The pipeline bubble ratio remained below 20% even with highly variable sequence lengths.
- Low Overhead: The online MILP solver finishes in under 5 seconds and its execution is overlapped with training, resulting in negligible overhead.
Conclusion
InfiniPipe demonstrates that embracing data heterogeneity is key to efficient long-context LLM training. By treating pipeline parallelism as a flexible, data-centric resource rather than a static constraint, EPP significantly improves throughput and hardware utilization. Future work includes scaling to thousands of GPUs and integrating with other horizontal parallelisms like Tensor Parallelism for models exceeding 100B parameters.
Summary updated