TL;DR
Training massive multi-task, multi-modal (MT MM) AI models is incredibly challenging due to complex dependencies and diverse workloads. This paper introduces "Spindle," a novel training system that uses "wavefront scheduling" to efficiently manage these complexities, achieving significant speedups over existing methods.
What Problem Does This Paper Address?
The field of AI is rapidly advancing with the development of large foundation models capable of handling multiple tasks and data types simultaneously. These MT MM models, like those powering advanced language understanding and image generation, are incredibly powerful but also computationally demanding to train. Existing distributed training systems are largely designed for single-task, single-modality models and struggle with the unique challenges posed by MT MM models:
- Workload Heterogeneity: Different tasks and modalities within an MT MM model have vastly different computational needs and data structures. For example, text processing might involve dense layers, while vision tasks might use layers that adapt to varying resolutions.
- Execution Dependencies: MT MM models often share components across tasks and modalities. This creates intricate dependencies where the output of one component is needed by another, leading to potential bottlenecks and inefficient execution if not managed carefully.
These challenges lead to underutilized hardware and slow training times, hindering the development and deployment of these advanced models.
Methods
Spindle tackles these problems with a novel system design centered around wavefront scheduling:
- Graph Contraction and MetaOps: The complex computation graph of an MT MM model is first simplified by "contracting" consecutive operators with similar workloads into "MetaOps." This reduces the problem's scale.
- MetaLevels: To disentangle dependencies, MetaOps are grouped into "MetaLevels," where MetaOps within the same level are independent. This allows for sub-problem decomposition.
- Scalability Estimator: Spindle develops a specialized estimator to accurately model how the execution time of each MetaOp changes with allocated resources. This goes beyond standard models to account for the heterogeneity of MT MM workloads.
- Resource Allocator: This component determines the optimal allocation of computational resources (GPUs) to MetaOps within each MetaLevel. It uses a continuous optimization approach (MPSP) and then discretizes the solution for practical allocation.
- Wavefront Scheduler: This is the core innovation. Instead of executing tasks sequentially or in large batches, Spindle breaks down MetaOps into "waves." Each wave is a unit of concurrent execution, where multiple sliced MetaOps are scheduled to run together. This "wavefront" approach aims to maximize device utilization and balance workloads across devices within each wave.
- Device Placement: Spindle employs intelligent strategies to assign MetaOps to specific devices, prioritizing intra-device communication and balancing memory load to further optimize efficiency.
- Runtime Engine: A sophisticated runtime engine manages the execution of the plan, handling inter-wave data dependencies and parameter synchronization.
Datasets
The paper evaluates Spindle on three representative MT MM workloads:
- Multitask-CLIP: A generalized version of CLIP, extended to 6 modalities and 10 multi-modal contrastive learning tasks.
- OFASys: A more general MT MM training workload supporting multiple modalities and tasks, using a unified encoder-decoder LM. 7 multi-modal tasks were used.
- QWen-VAL: A large-scale MT MM model (up to 9.25 billion parameters) supporting text, vision, and audio modalities. 3 tasks representing different modality combinations were used.
Key Insights and Ideas
- Wavefront Scheduling is Key: The core idea is that by breaking down computation into "waves" of concurrently executing, carefully scheduled MetaOps, Spindle can achieve much higher device utilization and efficiency than traditional methods.
- Heterogeneity is the Enemy of Uniformity: Standard training systems assume homogeneous workloads. Spindle's success hinges on its ability to precisely model and adapt to the diverse computational demands of different tasks and modalities within a single model.
- Operator-Level Optimization Matters: Optimizing at the task level is insufficient. Spindle's fine-grained, operator-level resource allocation and scheduling are crucial for balancing workloads and avoiding idle devices.
- Joint Optimization is Necessary: Spindle's strength comes from jointly optimizing resource allocation and execution scheduling, rather than treating them as separate problems.
Key Results
- Significant Speedups: Spindle achieved speedup ratios of up to 71% compared to state-of-the-art systems like Megatron-LM and DeepSpeed.
- Scalability: Spindle demonstrated excellent scalability with increasing task counts (up to 71% speedup on 10-task Multitask-CLIP) and cluster sizes.
- Efficiency: Spindle maintained high efficiency even when other systems' performance began to diminish with increased resources.
- Lower Memory Consumption: Spindle generally exhibited lower memory usage than SOTA systems, attributed to its operator-level strategy and selective parameter storage.
- Near-Optimal Execution Plans: Spindle's execution planner generated practical plans with minimal deviation from theoretical optimums.
Limitations and Future Work
- Practicality of Allocation: While Spindle's allocator aims for optimality, the discretization of continuous allocations and resource extension can introduce minor biases.
- Dynamic Workloads: The paper shows Spindle's adaptability to dynamic changes in workloads, but further exploration of more complex dynamic scenarios could be beneficial.
- Future Work: The authors suggest further research into optimizing inter-wave communication, exploring more sophisticated device placement strategies, and extending Spindle to even larger and more complex MT MM models.
Summary updated