Abstract
Scheduling computational tasks represented by directed acyclic graphs (DAGs) is challenging because of its complexity. Conventional scheduling algorithms rely heavily on simple heuristics such as shortest job first (SJF) and critical path (CP), and are often lacking in scheduling quality. In this paper, we present a novel learning-based approach to scheduling DAG tasks. The algorithm employs a reinforcement learning agent to iteratively add directed edges to the DAG, one at a time, to enforce ordering (i.e., priorities of execution and resource allocation) of "tricky" job nodes. By doing so, the original DAG scheduling problem is dramatically reduced to a much simpler proxy problem, on which heuristic scheduling algorithms such as SJF and CP can be efficiently improved. Our approach can be easily applied to any existing heuristic scheduling algorithms. On the benchmark dataset of TPC-H, we show that our learning based approach can significantly improve over popular heuristic algorithms and consistently achieves the best performance among several methods under a variety of settings.
Introduction
In modern computing environments—ranging from data processing pipelines to large-scale machine learning training—tasks are frequently modeled as Directed Acyclic Graphs (DAGs). In these graphs, nodes represent individual computations and edges denote execution dependencies. Efficiently scheduling these tasks on limited resources is a notoriously difficult problem, as it simultaneously addresses two NP-hard challenges: minimum makespan (optimizing task order for speed) and bin packing (fitting tasks into finite resource capacities).
Current systems typically rely on simple heuristics like Shortest Job First (SJF) or Critical Path (CP). While computationally efficient, these heuristics are often "blind" to the global structure of the DAG and specific resource constraints, leading to suboptimal schedules. Researchers from Ant Group have identified that these inefficiencies often stem from the mis-ordering of a few "tricky" nodes. If these critical decisions are guided correctly, even simple heuristics can achieve near-optimal performance.
The Proxy Problem Approach
The core innovation of this work is the transformation of the complex scheduling problem into a simpler "proxy problem." Instead of designing a new scheduler from scratch, the authors propose a reinforcement learning (RL) agent that learns to augment the original DAG with additional directed edges. These new edges do not represent functional dependencies but rather priority constraints: "Task A must complete before Task B begins."
By "breaking ties" between bottleneck nodes, the RL agent simplifies the task for traditional heuristics. As shown in the example above, a small modification to the graph topology can lead to a significant reduction in the total execution time (makespan) by resolving resource contention that simple heuristics would otherwise ignore.
Deep Reinforcement Learning Framework
The proposed framework utilizes a deep RL agent to iteratively select and add edges. The architecture consists of several key components:
- Graph Neural Network (GNN): The agent employs a GNN to encode the DAG's topology, incorporating node-level features such as estimated runtime and resource requirements. This allows the model to generalize across different graph structures.
- Policy Network: Based on the GNN embeddings, a policy network selects a "starting node" and an "ending node" to form a new edge. To manage the complexity of selecting from $O(n^2)$ possible pairs, the agent uses a sequential approach: picking the start node first, then the end node.
- Training and Reward: The model is trained using a Policy Gradient algorithm. The reward is defined as the reduction in makespan achieved by a target heuristic (e.g., SJF) on the modified graph compared to the original.
During inference, the system employs Beam Search to find an optimal sequence of edges to add, ensuring that the final "proxy" DAG is well-suited for the underlying heuristic.
Experimental Evaluation
The approach was evaluated using the TPC-H benchmark, a standard for decision support systems. Training involved merging sampled DAG sequences into larger instances, while testing was conducted on sets of varying sizes (5 to 20 DAGs) and resource tightness levels (1.0 to 1/3).
Key Results
The learning-based approach consistently outperformed standalone heuristics and established baselines like Tetris:
- Heuristic Enhancement: The RL agent reduced the makespan of SJF by up to 13.12% and CP by up to 14.77%.
- Generalization: Because the GNN learns structural patterns, the model trained on small DAGs successfully scaled to much larger, unseen task graphs.
- Robustness: Significant gains were observed regardless of whether task runtimes were fixed or followed a random distribution.
Conclusion and Future Work
This research demonstrates that RL can effectively "fix" the blind spots of classic scheduling heuristics by strategically modifying the input problem. While the current model focuses on single-dimension resources and static DAGs, future work aims to extend this to multi-dimensional resource constraints and dynamic, online streaming environments where tasks arrive over time. Additionally, exploring the transferability of models across different heuristics remains an open area for investigation.
Summary updated