Machine Learning on Volatile Instances

Xiaoxi Zhang, Jianyu Wang, Gauri Joshi, Carlee Joe-Wong

TL;DR

Training massive machine learning models is expensive, but using "volatile" cloud instances (like AWS Spot Instances) can slash costs by up to 65%. This paper provides the first theoretical framework to quantify how the random interruption of worker nodes affects model convergence, offering optimal bidding and provisioning strategies to balance cost, training time, and accuracy.

What Problem Does This Paper Address?

Distributed Stochastic Gradient Descent (SGD) is the workhorse of modern ML, but running it on high-performance GPUs for days is prohibitively expensive. Cloud providers offer "volatile" instances (e.g., AWS Spot, GCP Preemptible) at a fraction of the cost, with one catch: they can be reclaimed by the provider at any time if a higher-priority user needs them.

Standard optimization theory assumes a fixed number of workers. In a volatile environment, workers disappear and reappear randomly. This creates a "three-way tradeoff":

  1. Cost: Lower bids save money but increase the chance of interruptions.
  2. Time: Interruptions lead to "dead time" where no work happens, dragging out the training process.
  3. Error: Fewer active workers mean noisier gradient updates, which can hinder the model's ability to converge to a high accuracy.

The authors tackle the challenge of how to navigate these tradeoffs mathematically rather than by guesswork.

Methods

The researchers developed a two-pronged approach combining optimization theory with cloud economics:

  • New Convergence Analysis: They derived a new error bound for synchronous distributed SGD where the number of active workers varies over time. They discovered that the training error is proportional to the expected reciprocal of the number of active workers. This is a crucial "aha" moment: it’s not just the average number of workers that matters, but how often you are left with very few.
  • Optimal Bidding Strategies: For AWS-style markets, they derived closed-form solutions for the "Optimal-two-bids" strategy. Instead of bidding the same for everyone, they split workers into two groups with different bid prices to ensure that even if the price spikes, some workers might remain active.
  • Dynamic Provisioning: For platforms like GCP or Azure where you can't "bid" but only choose the number of instances, they proposed a strategy that exponentially increases the number of workers as training progresses. This aligns with the intuition that early training can tolerate noise, while the final "fine-tuning" stages require more precise (and thus more numerous) gradient updates.

Datasets

The authors validated their strategies using the CIFAR-10 image classification dataset. They tested two different model architectures:

  • ResNet-50: A deep, industry-standard residual network.
  • Small CNN: A lighter convolutional neural network with two convolutional layers and three fully connected layers.

Experiments were conducted using both synthetic spot price traces (Uniform and Gaussian distributions) and real-world historical price data from Amazon EC2’s c5.xlarge instances.

Key Insights and Ideas

  • The Penalty of Volatility: The paper mathematically proves that running on volatile instances always yields worse error convergence than stable instances for the same number of iterations. However, the cost savings often justify the extra iterations needed to catch up.
  • Heterogeneous Bidding is Key: Bidding two different prices for two groups of workers is significantly more efficient than a single uniform bid. It creates a "safety net" that prevents the number of active workers from frequently hitting zero.
  • The "Dynamic" Advantage: The most effective strategy was increasing the worker count over time. By starting small and ending large, they achieved a better "accuracy per dollar" than static configurations. This is because the marginal benefit of an extra worker is higher when the model is closer to its optimal state.

Key Results

  • Massive Cost Savings: The derived optimal bidding strategies reduced costs by 65% compared to an "aggressive" strategy (bidding high to avoid interruptions) while meeting the same error and time deadlines.
  • Efficiency vs. Speed: While "no-interruption" (on-demand) training is faster in terms of wall-clock time, the authors' dynamic strategy achieved 98% accuracy at one-third the cost.
  • Robustness: The strategies held up even when using real historical spot price traces, which are often non-ideal and unpredictable, proving the practical utility of their theoretical bounds.

Limitations and Future Work

  • Centralized Bottleneck: The current model assumes the "Parameter Server" (the coordinator) stays on a stable, on-demand instance. If the coordinator is also volatile, the system would need complex checkpointing and migration logic, which the authors note as a significant overhead.
  • Synchronous Focus: The analysis focuses on synchronous SGD (where the server waits for all active workers). While they suggest the insights could extend to asynchronous versions, the specific math for "stale" gradients in a volatile environment remains an open area.
  • Future Directions: The authors suggest extending this to "edge computing" scenarios, where workers might be mobile devices with fluctuating power budgets instead of cloud VMs with fluctuating prices.

Summary updated

BibTeX
@inproceedings{zhang2020machine,
  author = {Xiaoxi Zhang and Jianyu Wang and Gauri Joshi and Carlee Joe-Wong},
  title = {{Machine Learning on Volatile Instances}},
  booktitle = {INFOCOM},
  year = {2020},
  url = {https://openreview.net/forum?id=4bXwzcBYaGA},
}

Loading related content...

Figure