Srift: Swift and Thrift Cloud-Based Distributed Training

Liang Luo, Peter West, Arvind Krishnamurthy, Luis CezearXiv 2020

Abstract

Finding the best VM configuration is key to achieve lower cost and higher throughput, two primary concerns in cloud-based distributed neural network (NN) training today. Optimal VM selection that meets user constraints requires efficiently navigating a large search space while controlling for the performance variance associated with sharing cloud instances and networks. In this work, we characterize this variance in the context of distributed NN training and present results of a comprehensive throughput and cost-efficiency study we conducted across a wide array of instances to prune for the optimal VM search space. Using insights from these studies, we built Srifty, a system that combines runtime profiling with learned performance models to accurately predict training performance and find the best VM choice that satisfies user constraints, potentially leveraging both heterogeneous setups and spot instances. We integrated Srifty with PyTorch and evaluated it on Amazon EC2. We conducted a large-scale generalization study of Srifty across more than 2K training setups on EC2. Our results show that Srifty achieves an iteration latency prediction error of 8%, and its VM instance recommendations offer significant throughput gain and cost reduction while satisfying user constraints compared to existing solutions in complex, real-world scenarios.

Introduction

Training large-scale neural networks in the cloud is notoriously expensive, often costing millions of dollars. To manage these costs, users must choose from a dizzying array of Virtual Machine (VM) configurations. However, finding the "optimal" setup is difficult for two main reasons: the massive search space and the inherent performance variance of cloud environments.

The "Cloud Tax": Performance Variance

Unlike dedicated clusters, cloud environments are multi-tenant. Network congestion and hardware sharing cause significant performance fluctuations. The authors found that communication latency can vary by up to 2x and compute by 1.1x for the exact same workload, making simple performance predictions unreliable.

Figure 4: Communication latency variance for 256MB transfers without placement groups, showing up to 1.8x difference.

Existing tools often ignore this variance or fail to account for the overlapping of computation and communication in modern deep learning frameworks. Srifty is designed to navigate these complex trade-offs between VM types, costs, and performance variance.

Methods

Srifty tackles these challenges through a multi-stage pipeline:

  • Lightweight Profiling: Srifty uses PyTorch hooks to record execution timestamps for a single training iteration. This captures the specific "compute-to-communication" ratio of a model without requiring heavy instrumentation.
  • Learned AllReduce Model: Instead of relying on theoretical peak bandwidth, Srifty uses an XGBoost regression model trained on 40,000 real-world measurements across Amazon EC2. It predicts "bus bandwidth" to account for different network topologies and scales.
  • Iteration Simulator: To predict the total time per step, Srifty runs a simulation that "replays" the training loop, accounting for how modern frameworks overlap the backward pass with gradient synchronization (AllReduce).
  • Hybrid Constraint Solver: Srifty prunes the search space using empirical takeaways and then uses a mix of exhaustive search and Integer Linear Programming (ILP) to find a configuration that minimizes cost or time while staying within user-defined limits.

Key Insights and Ideas

  • Bus Bandwidth as a Stable Metric: Predicting raw latency is difficult because it varies wildly with message size. Predicting "bus bandwidth" (effective physical throughput) reduces "aliasing" and leads to much higher accuracy.
  • Iteration Latency Stability: While individual components vary, Srifty characterizes the distribution of iteration latencies to provide robust recommendations.
Figure 5: Distribution of iteration latency across 760 VMs (left) and 2500 iterations (right), demonstrating the ~1.1x variance in compute-heavy workloads.
  • The Power of Heterogeneity: Srifty demonstrates that mixing different VM types can satisfy constraints that homogeneous clusters cannot. For example, a mix of high-performance and low-cost VMs might be the only way to meet both a strict budget and a strict deadline.

Key Results

  • High Prediction Accuracy: Srifty achieved a Mean Absolute Percentage Error (MAPE) of just 8.3% for end-to-end iteration latency across 2,000 different training setups, a significant improvement over the 24% error seen in strong baseline models.
  • Cost and Throughput Gains: In real-world case studies on EC2, Srifty found configurations that provided up to a 7% throughput gain or a 1.26x cost reduction compared to standard greedy heuristics.
  • Resilience: In a simulated spot instance preemption, Srifty successfully detected the interrupt and re-configured the cluster to finish the job within the original time limit.

Conclusion

Srifty provides a robust framework for optimizing cloud-based distributed training. By accurately modeling performance variance and navigating a complex search space, it enables users to achieve significant cost savings and throughput improvements while meeting strict operational constraints.

Summary updated

BibTeX
@misc{luo2020srift,
  author = {Liang Luo and Peter West and Arvind Krishnamurthy and Luis Ceze},
  title = {{Srift: Swift and Thrift Cloud-Based Distributed Training}},
  year = {2020},
  eprint = {2011.14243},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.14243},
}
Figure