TL;DR
Training massive deep neural networks (DNNs) across multiple machines is crucial for AI, but achieving efficient speedups is surprisingly difficult. This paper introduces dPRO, a toolkit that automatically diagnoses performance bottlenecks in distributed DNN training and suggests optimizations, achieving up to 3.48x speedup.
What Problem Does This Paper Address?
As DNN models grow and datasets expand, distributed training across multiple GPUs and servers has become essential. However, the performance gains from adding more hardware often fall far short of the ideal linear speedup. This is due to a complex interplay of factors like stragglers (slow workers), communication overhead, suboptimal synchronization, and inefficient computation. Identifying the root cause of these inefficiencies is a significant challenge, requiring deep expertise and manual analysis of intricate runtime traces. Existing tools lack a holistic view of the distributed system and struggle to automatically suggest effective optimizations across different frameworks and communication strategies.
Methods
dPRO tackles this problem with a three-module system:
- Profiler: This module automatically collects fine-grained runtime traces from multiple deep learning frameworks (TensorFlow, MXNet) and communication schemes (AllReduce, Parameter Server). A key innovation is its ability to construct a global Data Flow Graph (DFG) by aligning timestamps across different devices (even without perfect clock synchronization) and accurately capturing inter-worker communication.
- Replayer: Based on the global DFG, the replayer simulates the distributed training process to estimate per-iteration training time. It uses a modified Kahn's algorithm and can perform partial replay to efficiently estimate communication costs.
- Optimizer: This module takes the global DFG and uses the replayer to iteratively identify bottlenecks along the critical path of execution. It then explores a range of optimization strategies, including operator fusion, tensor fusion, and tensor partitioning, guided by theoretical analysis and a novel Coarsened View of the DFG to reduce the search space. The optimizer aims to find the best combination of strategies to minimize iteration time.
Datasets
The paper evaluates dPRO on standard deep learning benchmarks:
- ResNet50
- VGG16
- InceptionV3
- BERT Base
These models are trained using various configurations of ML frameworks (TensorFlow, MXNet), communication libraries (Horovod, BytePS), and network transports (TCP, RDMA).
Key Insights and Ideas
- The complexity of distributed training: Even with state-of-the-art communication methods, achieving linear speedup is challenging due to a multitude of interacting factors.
- The need for a global view: Local profiling is insufficient; a global, synchronized view of computation and communication across all workers is essential for accurate diagnosis.
- Timestamp alignment is critical: Clock drifts and the nature of communication operations (e.g., RECV start time vs. actual data reception) necessitate sophisticated time alignment techniques for accurate trace analysis.
- Optimization interactions matter: Simple application of individual optimizations (like operator fusion) can sometimes hurt overall performance due to reduced overlap between computation and communication. dPRO's strength lies in exploring these combined effects.
- Coarsened View for efficient search: By grouping related operations and tensors, dPRO significantly reduces the search space for optimization strategies, making the process tractable.
Key Results
- High Replay Accuracy: dPRO's replayer achieves less than 5% error in predicting iteration time across various settings, significantly outperforming Daydream (up to 70.2% error).
- Significant Speedups: dPRO's optimizer finds strategies that achieve up to 3.48x speedup compared to baselines and XLA's default optimizations.
- Effective Optimization Strategies:
- Operator fusion alone yielded up to 51.843% speedup over XLA's default.
- Combined op fusion and tensor fusion/partition strategies achieved up to 62.95% acceleration over XLA and 26.44% over default Horovod/BytePS.
- Accurate Memory Estimation: dPRO's memory estimation accuracy is within 5.25% relative error.
- Search Speedup: dPRO's search acceleration techniques reduce the optimization search time by orders of magnitude.
- Scalability: dPRO demonstrates good performance and accuracy even on large-scale clusters with up to 128 GPUs.
Limitations and Future Work
- Search Time: While significantly improved, the search for optimal strategies can still take hours for very large models, though dPRO's techniques drastically reduce this.
- Future Work: The authors suggest that dPRO can be extended to support pipeline-parallel training and that developers can register custom optimization strategies, which dPRO can then automatically explore. The framework is designed to be extensible to new ML frameworks and communication architectures.
Summary updated