TL;DR
CFP (Communication-Free Preserve) is a profiling-based optimization system that automates intra-operator parallelism for large-scale model training. By exploiting structural repetitions and identifying "ParallelBlocks" that preserve data locality, CFP reduces the massive search space of parallelism plans and uses real-world profiling to find optimal strategies that outperform state-of-the-art frameworks like Alpa by up to 3.43x.
What Problem Does This Paper Address?
Training modern large language models (LLMs) requires distributing computation across hundreds or thousands of GPUs. A key technique is intra-operator parallelism, where a single operation (like a large matrix multiplication) is split across multiple devices.
However, finding the "optimal" way to split these operations is incredibly difficult. A typical model has tens of thousands of primitive operators, creating an exponential search space. Existing frameworks like Alpa rely on symbolic cost models—mathematical formulas that estimate cost based on the number of bytes moved or floating-point operations performed.
The authors argue that these static models are often wrong. Compilers frequently fuse operations or optimize communication in ways the static model can't predict. Furthermore, runtime factors like hardware-specific communication libraries can cause actual performance to deviate wildly from theoretical estimates. As shown in Figure 1, a plan that looks better on paper might actually be 40% slower in practice due to compiler-induced overhead.
Methods
CFP introduces a profile-based approach that measures actual execution time rather than guessing it. To make this computationally feasible, they employ three core techniques:
- ParallelBlocks: The system identifies subgraphs where data dependencies allow computation to proceed independently on each parallel partition from input to output. By grouping these into a single "ParallelBlock," the system ensures the entire block uses a consistent parallel strategy, drastically pruning the search space without losing the global optimum.
- Repetitive Pattern Fingerprinting: Large models are mostly composed of repeating layers (e.g., Transformer blocks). CFP uses a novel fingerprinting mechanism based on element-level data dependency graphs to identify these identical segments. This allows the system to profile a single representative segment and reuse those results across the entire model.
- Profiling-Based Cost Estimation: Instead of a formula, CFP compiles and runs sampled parallelism plans on the target hardware. It collects real-world data on computation time, communication overhead, and memory usage.
- Dynamic Programming (DP) Search: With the search space reduced and accurate costs in hand, CFP uses a DP algorithm to find the global parallelism plan that maximizes throughput while staying within the GPU's memory limits.
Datasets
The system was evaluated using four prominent large-scale models:
- BERT
- GPT
- GShard MoE (Mixture of Experts)
- LLaMA-2
These models were tested on two different hardware configurations: a cluster of NVIDIA A100-PCIe GPUs and a node of NVIDIA V100-NVLink GPUs.
Key Insights and Ideas
- Static Models are Fragile: The paper highlights that compiler optimizations (like RNG operator restrictions or kernel fusion) are "black boxes" to traditional symbolic models. Profiling is the only way to capture the true cost of the physical execution graph.
- Preserving Communication-Free Structures: By identifying subgraphs that don't require inter-device communication (ParallelBlocks), the system naturally gravitates toward high-efficiency plans. Figure 3 illustrates how complex operations like self-attention can be viewed as parallelism-preserving structures.
- Fingerprinting over Operator Matching: Simply matching operator types isn't enough to identify repetitive segments because trivial variations (like a stray reshape op) can break the match. CFP’s element-level affine mapping fingerprint is robust to these variations.
Key Results
CFP consistently outperformed state-of-the-art frameworks across different models and batch sizes:
- Speedups: Compared to Alpa, CFP achieved up to 1.51x speedup on GPT, 1.31x on LLaMA, and a massive 3.43x on MoE models.
- Efficiency: The entire optimization process—from analysis to finding the final plan—takes less than 15 minutes for each model.
- Memory Awareness: Unlike Alpa, which often failed with Out-of-Memory (OOM) errors as models grew, CFP’s memory-constrained DP search successfully found viable plans for deeper models and larger batch sizes.
Limitations and Future Work
The authors acknowledge two primary limitations:
- Single-Level Parallelism: Currently, CFP focuses on intra-operator parallelism. While it can be combined with data parallelism, it does not yet natively optimize pipeline (inter-operator) parallelism in a unified search.
- Communication/Computation Overlap: The current profiling doesn't fully account for the complex overlapping of communication and computation kernels, which could introduce further performance uncertainties.
Future work aims to extend the profiling mechanism to pipeline stages and improve the modeling of multi-granularity kernel overlapping.
Summary updated