Abstract
Transformer models have achieved state-of-the-art performance across various domains and have become the foundation for advanced large deep learning (DL) models. However, training these models over multiple GPUs efficiently remains challenging due to the vast number of parallelism choices. Existing DL systems often rely on manual effort to design distributed training plans or explore a limited search space. We propose Galvatron, a system framework that incorporates multiple popular parallelism dimensions and automatically identifies the most efficient hybrid parallelism strategy. By utilizing a decision-tree-based decomposition and a dynamic programming search algorithm, Galvatron navigates a massive search space to generate optimal plans. Evaluations on four representative Transformer workloads demonstrate that Galvatron achieves superior system throughput compared to previous methods across various GPU memory budgets.
Introduction
As Transformer-based models like BERT, T5, and Swin Transformer grow to billions of parameters, they exceed the memory capacity of individual GPUs. Distributed training—splitting the model or data across multiple chips—is no longer optional. However, the design space for distributed training is immense. Engineers must choose between Data Parallelism (DP), Sharded Data Parallelism (SDP), Tensor Parallelism (TP), and Pipeline Parallelism (PP) for every layer. For a 100-layer model, the combinatorial possibilities are staggering, and manual optimization often yields sub-optimal results.
Galvatron addresses this by automating the search for the most efficient hybrid parallelism strategy, ensuring that hardware resources are fully utilized regardless of the specific model architecture or GPU cluster configuration.
Methodology
Galvatron introduces a structured approach to navigate the "rarely huge" search space of parallelism strategies through three core components:
1. Decision-Tree-Based Decomposition
To avoid the computational impossibility of brute-forcing billions of combinations, Galvatron uses a decision tree to prune the search space. This process is guided by empirical heuristics. For instance, the system prioritizes Pipeline Parallelism across slower inter-node links (such as Ethernet) while reserving high-bandwidth intra-node links (like NVLink) for communication-heavy Tensor Parallelism. This decomposition reduces the search space to a manageable size without sacrificing the quality of the final plan.
2. Dynamic Programming (DP) Search
Once the search space is pruned, Galvatron employs a dynamic programming algorithm to identify the global optimum. The algorithm calculates the execution time for each layer under various strategies and, crucially, accounts for "transformation costs." These costs represent the overhead incurred when adjacent layers use different parallelism strategies, requiring data to be reshuffled across the GPU cluster.
3. Refined Cost Estimator
Traditional systems often estimate performance by simply summing computation and communication times. Galvatron improves upon this by modeling the "overlapping slowdown." When a GPU performs computation and communication simultaneously, resource contention typically slows both processes by approximately 1.3x. By incorporating this factor, Galvatron’s cost model achieves significantly higher predictive accuracy.
Experimental Evaluation
The framework was evaluated on four representative workloads: BERT (NLP Encoder), T5 (NLP Encoder-Decoder), ViT (Standard Vision Transformer), and Swin Transformer (Hierarchical Vision Transformer). Tests were conducted on clusters of 8, 16, and 64 GPUs using Nvidia RTX TITAN and A100 hardware.
Key Results
- Throughput Gains: On 8-GPU setups, Galvatron achieved up to 338% higher throughput compared to pure parallelism baselines and a 55% speedup over state-of-the-art hybrid systems like DeepSpeed 3D.
- Memory Efficiency: Galvatron successfully trained 10-billion-parameter models (e.g., BERT-xHuge) on 64 GPUs, whereas many baseline systems failed due to Out-Of-Memory (OOM) errors.
- Search Efficiency: The optimization algorithm generates optimal training plans in seconds to minutes, a negligible overhead compared to the weeks required for large-scale training.
Insights and Discussion
Galvatron’s automated approach revealed several nuances in distributed training. For example, in Swin Transformers, shallower layers with large activations prefer Data Parallelism, while deeper layers with more parameters benefit from Tensor Parallelism. Additionally, the system demonstrated that pure Sharded Data Parallelism (SDP) is almost always superior to a hybrid of standard DP and SDP, allowing for further simplification of the search space.
One of the most critical findings was the impact of the "overlapping tax." Ignoring the performance degradation caused by simultaneous compute and communication leads to a 15% error in cost estimation. By accounting for this 1.3x slowdown, Galvatron selects strategies that translate more effectively to real-world hardware performance.
Conclusion and Future Work
Galvatron provides a robust framework for automating the complex task of distributing Transformer training. While highly effective, the current version has limitations that provide avenues for future research, including the integration of activation recomputation and support for heterogeneous hardware clusters (mixing different GPU types). Furthermore, expanding the search space to include expert-parallelism for Mixture-of-Experts (MoE) models remains a priority for future iterations.
Summary updated