Abstract
ML workloads are becoming increasingly popular in the cloud. Good cloud training performance is contingent on efficient parameter exchange among VMs. We find that Collectives, the widely used distributed communication algorithms, cannot perform optimally out of the box due to the hierarchical topology of datacenter networks and multi-tenancy nature of the cloud environment. In this paper, we present Cloud Collectives, a prototype that accelerates collectives by reordering the ranks of participating VMs such that the communication pattern dictated by the selected collectives operation best exploits the locality in the network. Collectives is non-intrusive, requires no code changes nor rebuild of an existing application, and runs without support from cloud providers. Our preliminary application of Cloud Collectives on allreduce operations in public clouds results in a speedup of up to 3.7x in multiple microbenchmarks and 1.3x in real-world workloads of distributed training of deep neural networks and gradient boosted decision trees using state-of-the-art frameworks.
Introduction
In distributed machine learning, workers must constantly exchange data (gradients or parameters) using operations called "collectives" (like allreduce). In a traditional Supercomputer/HPC environment, the network topology is known and fixed. However, in the cloud (AWS, Azure), the network is a "black box."
Because of hierarchical datacenter designs and "noisy neighbors" (multi-tenancy), the time it takes for VM A to talk to VM B might be significantly longer than for VM A to talk to VM C. Standard collective libraries often use a randomly ordered list of IPs to form communication rings or trees. If a "slow" link ends up on the critical path of a communication ring, the entire training job slows down. The bottleneck for cloud ML has shifted from raw computation to these inefficient communication patterns.
Methodology
The authors propose a three-step, non-intrusive pipeline to optimize these collectives:
- Network Probing: Since cloud providers don't reveal their physical topology, the tool uses low-level network probes (using DPDK or
fping) to measure the Round-Trip Time (RTT) between every pair of VMs. They use the 10th percentile of these measurements to filter out transient network noise. - Cost Modeling: They developed mathematical models for common collective algorithms (Ring, Halving-Doubling, Tree, and BCube). These models calculate the "cost" of an operation based on the specific pairwise latencies measured in step one.
- Rank Reordering (Optimization): Finding the perfect order of VMs is an NP-hard optimization problem. The authors use a two-stage approach: a stochastic search using simulated annealing followed by an SMT solver (Z3) to find a near-optimal arrangement that minimizes total communication cost.
Crucially, this is a "drop-in" solution. Users simply provide the reordered IP list to their existing frameworks (like PyTorch or LightGBM) without rebuilding the application.
Discussion: The "Hidden" Hierarchy
Even in the cloud, physical locality (being in the same rack) matters immensely. A heatmap of latencies clearly illustrates non-uniform performance across VM ranks, where certain clusters of VMs exhibit much lower latency than others.
Not all algorithms benefit equally. Ring-based algorithms saw the biggest gains because their performance is strictly tied to the "slowest link" in the chain. Tree-based and BCube algorithms have more complex critical paths, making them slightly more resilient to bad ordering but harder to optimize. A key insight is that RTT (latency) is an excellent proxy for bandwidth in TCP-based cloud networks. By minimizing latency, the tool effectively maximizes the available throughput for the ML job.
Key Results
The tool achieved significant performance improvements across various setups, particularly for ring-based collectives.
- Microbenchmarks: A speedup of up to 3.7x for
allreduceoperations in public clouds. - Real-world Training: LightGBM training was accelerated by 1.3x, while distributed deep learning (AlexNet) saw a 1.2x increase in training throughput.
- Predictive Power: The cost models showed a high correlation (up to 0.94 Spearman coefficient) with actual measured performance, proving that offline optimization accurately reflects online reality.
Conclusion and Future Work
While latency is a good proxy, it isn't perfect for strictly bandwidth-bound transfers. Additionally, cloud traffic is dynamic; a rank order that is optimal at one time might be sub-optimal later due to multi-tenancy. Future work could involve dynamic rank adjustment during long-running jobs and more efficient probing methods to scale to thousands of nodes.
Summary updated