Abstract
As the artificial intelligence community advances into the era of large models with billions of parameters, distributed training and inference have become essential. While various parallelism strategies—data, model, sequence, and pipeline—have been successfully implemented for popular neural networks on mainstream hardware, optimizing the distributed deployment schedule requires extensive expertise and manual effort. Furthermore, while existing frameworks handle simple chain-like structures well, they struggle with complex non-linear architectures like Mixture-of-Experts (MoE) and multi-modal models. We propose formulating parallelism planning as a scheduling optimization problem using mixed-integer programming (MIP). Our bi-level solution framework balances optimality with computational efficiency, automatically generating effective distributed plans that capture both the heterogeneous structure of modern neural networks and underlying hardware constraints. In experiments comparing against expert-designed strategies like DeepSeek's DualPipe, our framework achieves comparable or superior performance, reducing computational bubbles by half under the same memory constraints.
The Challenge of Large-Scale Parallelism
Training Large Language Models (LLMs) with trillions of parameters is no longer possible on a single chip. To achieve the necessary scale, engineers employ a complex combination of parallelism strategies: Data (splitting batches), Tensor (splitting layers), and Pipeline (splitting the model into stages).
However, designing these execution schedules is currently considered a "black art." It requires elite engineers to manually balance memory limits, communication overhead, and hardware constraints. As models evolve from simple linear chains toward complex, non-linear architectures—such as MoE or multi-modal models with branch-rich topologies—manual scheduling becomes nearly impossible and highly prone to inefficiency, creating "bubbles" where expensive GPUs sit idle.
Methodology: A Mathematical Approach to Scheduling
Researchers from Huawei's Noah’s Ark Lab have developed a framework that treats deep learning parallelism as a rigorous mathematical optimization problem. The system bridges the gap between theoretical scheduling and practical AI deployment through a bi-level approach:
- MIP Formulation: The scheduling problem is framed as a variant of the Flexible Distributed Job Shop Scheduling Problem (FDJSSP). The model accounts for operation durations, memory requirements (distinguishing between weights and activations), and communication costs between devices.
- Graph Coarsening: Solving a pure MIP for a graph with thousands of nodes is NP-hard. To address this, the framework introduces a heuristic that "pre-merges" safe operation pairs—nodes that do not increase the critical path—to reduce the graph size to a manageable scale (typically under 100 nodes).
- Optimal Solving: The simplified graph is processed by a commercial solver (Gurobi) to find the mathematically optimal schedule for the given hardware constraints.
Experimental Validation: Outperforming Human Experts
The framework was evaluated against the DeepSeek-V3 Architecture, specifically aiming to improve upon the DualPipe scheduling strategy.
Key Insights and Results
- Beating the Experts: The automated solver identified "bi-directional interweaving patterns" that human experts missed. By exploring a larger solution space, the MIP found schedules that reduced idle time (bubbles) by 50% under the exact same memory constraints as DualPipe.
- Hidden Communication: The solver successfully identified sequences where communication tasks were fully overlapped with computation. This ensures data moves between chips while the hardware is busy, leading to near-zero latency overhead.
- Flexibility and Efficiency: Unlike existing frameworks (like Alpa or Megatron-LM) that often assume linear layer chains, this approach works on any Directed Acyclic Graph (DAG). On synthetic random graph tests, the framework achieved the theoretical maximum speedup of 2x on a 2-machine cluster.
Conclusion and Future Outlook
This framework demonstrates that mathematical optimization can outperform manual expert design in the complex domain of distributed training. By reducing computational bubbles and maximizing hardware utilization, it serves as both a valuable research tool for exploring optimal strategies and a practical solution for large-scale AI deployment.
Future work will focus on enhancing scalability for extremely large clusters and incorporating support for heterogeneous hardware environments, such as clusters featuring mixed GPU generations or varying interconnect speeds.
Summary updated