Abstract
Training machine learning (ML) models with large datasets can incur significant resource contention on shared clusters. This training typically involves many iterations that continually improve the quality of the model. Yet in exploratory settings, better models can be obtained faster by directing resources to jobs with the most potential for improvement. We describe SLAQ, a cluster scheduling system for approximate ML training jobs that aims to maximize the overall job quality. When allocating cluster resources, SLAQ explores the quality-runtime trade-offs across multiple jobs to maximize system-wide quality improvement. To do so, SLAQ leverages the iterative nature of ML training algorithms, by collecting quality and resource usage information from concurrent jobs, and then generating highly-tailored quality-improvement predictions for future iterations. Experiments show that SLAQ achieves an average quality improvement of up to 73% and an average delay reduction of up to 44% on a large set of ML training jobs, compared to resource fairness schedulers.
Introduction: The Problem with Fair Scheduling
Traditional cluster schedulers, such as YARN or Mesos, are designed for general-purpose big data tasks with a primary goal of resource fairness. They ensure every job receives an equal share of CPU and memory. However, machine learning (ML) training is fundamentally different from standard batch processing.
ML training is iterative and exhibits significant diminishing returns. As shown in Figure 1, a model often achieves 80% of its quality improvement in the first 20% of its training time. Under a fair scheduler, a job that is 99% converged receives the same resources as a new job that could see massive quality gains with a few extra CPU cores. This quality-agnostic approach is inefficient in exploratory environments where data scientists need "good enough" models quickly to iterate on hyperparameters.
The SLAQ Approach
SLAQ introduces a "quality-driven" approach to scheduling through three main components:
- Loss Normalization: Different ML algorithms (e.g., Logistic Regression vs. K-Means) have vastly different loss scales. SLAQ normalizes the change in loss relative to the largest change observed so far, allowing the scheduler to compare progress across heterogeneous jobs on a scale of 0 to 1.
- Online Quality Prediction: SLAQ leverages the mathematical convergence properties of optimization algorithms. It fits curves to historical loss values to predict future improvement. For example, it uses sublinear models for Gradient Descent and linear/superlinear models for L-BFGS.
- Greedy Allocation: In each scheduling epoch, SLAQ solves an optimization problem to maximize total system-wide loss reduction. It ensures a minimum resource allocation (one core) to prevent starvation, then iteratively assigns remaining cores to jobs predicted to yield the highest quality improvement.
Evaluation and Key Results
The authors evaluated SLAQ on a 20-node AWS cluster running Apache Spark (MLlib) with over 200GB of diverse datasets (text, images, audio). The workloads included classification, regression, and unsupervised learning.
SLAQ demonstrated significant performance gains over standard fair schedulers:
- Superior Quality: SLAQ achieved an average normalized loss that was 73% lower across a mix of 160 concurrent jobs (see Figure 4).
- Faster Iteration: SLAQ reached a 90% loss reduction 45% faster than fair scheduling, reducing wait times from 71s to 39s.
- Scalability: The scheduling logic is highly efficient, making decisions for 4,000 jobs across 16,000 cores in just a few seconds.
Insights and Future Directions
The core insight of SLAQ is that loss functions serve as a universal currency for scheduling across different ML tasks. By shifting resources from "nearly converged" jobs to "high-potential" jobs, the entire system reaches a higher state of utility much faster.
While highly effective for convex optimization, current limitations include handling non-convex problems like Deep Learning, where loss functions may not follow predictable convergence curves. Future work may involve incorporating user-defined quality targets to allow for even more aggressive resource reclamation.
Summary updated