Learning scheduling algorithms for data processing clusters

Hongzi Mao, Malte Schwarzkopf, Shaileshh Bojja Venkatakrishnan, Zili Meng, Mohammad Alizadeh

TL;DR

Decima is the first reinforcement learning (RL) based scheduler that automatically learns workload-specific policies for complex, DAG-structured data processing jobs. By combining Graph Neural Networks with novel RL training techniques, it outperforms hand-tuned heuristics by over 21%—and up to 2x under heavy load—without requiring human-designed rules.

What Problem Does This Paper Address?

Efficiently scheduling jobs in a data processing cluster (like Spark or Hadoop) is an algorithmic nightmare. Modern jobs aren't just single tasks; they are Directed Acyclic Graphs (DAGs) of dependent stages. To minimize job completion time, a scheduler must decide:

  1. Which stage to run next? (Respecting dependencies).
  2. How many resources (parallelism) to give each job? (Balancing speedup against diminishing returns).

Current systems rely on simple, "one-size-fits-all" heuristics like Fair Sharing or FIFO. These ignore the specific structure of the workload. While an expert could manually tune a policy for a specific cluster, it is labor-intensive and doesn't scale as workloads change. Standard Reinforcement Learning—the usual "AI" solution for complex control—traditionally fails here because the state space (hundreds of jobs, thousands of machines) is too massive and the arrival of jobs is unpredictable and continuous.

Methods

The authors introduce Decima, a framework that "learns" scheduling through experience in a simulated environment before being deployed. Its architecture features three key innovations:

  • Graph Neural Networks (GNNs): Instead of using a fixed-size feature vector, Decima uses GNNs to process job DAGs of any shape or size. It computes "embeddings" that capture critical information, such as the length of the "critical path" (the longest sequence of dependent tasks) and the total work remaining.
  • Two-Dimensional Action Space: To keep the problem tractable, Decima breaks scheduling into a series of simple decisions: (1) which stage to schedule and (2) what the upper limit for parallelism should be for that job.
  • Stochastic Training Techniques: To handle continuous job arrivals, the authors used Curriculum Learning (starting with short sequences of jobs and gradually increasing complexity) and a variance reduction technique that fixes the job arrival sequence across multiple training episodes. This ensures the RL agent learns from its own decisions rather than just getting "lucky" or "unlucky" with the job arrival pattern.

Datasets

The researchers evaluated Decima using two primary sources:

  1. TPC-H Benchmarks: A standard industry-standard suite of 22 complex SQL queries, run on a real 25-node Spark cluster.
  2. Alibaba Production Trace: A massive dataset containing roughly 20,000 jobs from a real-world production cluster, used for large-scale simulations of multi-resource (CPU and Memory) scheduling.

Key Insights and Ideas

  • Parallelism is a Curve, Not a Constant: Decima learns that different jobs have different "sweet spots." Giving a small job more executors might finish it instantly, while giving a massive job more executors might yield diminishing returns due to communication overhead.
  • Trading Fragmentation for Throughput: In multi-resource tests, Decima learned a surprising "pro-move": it would occasionally use "oversized" executors (e.g., using a high-memory slot for a low-memory task) just to clear a small job out of the queue faster. This "waste" actually improved overall cluster latency.
  • The Power of Two-Level Aggregation: The authors found that standard GNNs couldn't compute the "critical path" of a DAG. They added a second non-linear transformation to the GNN's aggregation step, which allowed the model to learn the "max" operation necessary to identify bottlenecks.

Key Results

  • Real-World Spark Performance: On a 25-node cluster, Decima reduced average job completion time by 21% compared to the best hand-tuned heuristics.
  • High-Load Resilience: During periods of high cluster load, Decima achieved up to a 2x speedup over traditional fair scheduling.
  • Multi-Resource Gains: In simulations using the Alibaba trace, Decima outperformed state-of-the-art packing heuristics (like Graphene) by 32% to 43%.
  • Efficiency: Despite the complex neural network, Decima makes scheduling decisions in less than 15ms, imposing negligible overhead on the system.

Limitations and Future Work

  • Non-Preemptive: Decima currently does not "preempt" (stop) running tasks; it only makes decisions when a stage completes or a new job arrives. Adding preemption would significantly expand the action space.
  • Fairness: Decima is currently optimized for performance (Job Completion Time). It does not have an explicit mechanism to ensure "fairness" between different users, which is often a requirement in shared corporate clusters.
  • Online Adaptation: While Decima generalizes well to similar workloads, it currently trains offline. The authors suggest that "meta-learning" could allow the agent to adapt to entirely new, unseen workloads in real-time.

Summary updated

BibTeX
@inproceedings{mao2019learning,
  author = {Hongzi Mao and Malte Schwarzkopf and Shaileshh Bojja Venkatakrishnan and Zili Meng and Mohammad Alizadeh},
  title = {{Learning scheduling algorithms for data processing clusters}},
  booktitle = {SIGCOMM},
  year = {2019},
  doi = {10.1145/3341302.3342080},
}
Figure