Edge Generation Scheduling for DAG Tasks Using Deep Reinforcement Learning

Binqi Sun, Mirco Theile, Ziyuan Qin, Daniele Bernardini, Debayan Roy, Andrea Bastoni, Marco Caccamo

TL;DR

This paper introduces a novel framework called Edge Generation Scheduling (EGS) that simplifies real-time Directed Acyclic Graph (DAG) task scheduling by iteratively adding artificial dependencies (edges) to reduce graph width without violating deadlines. By combining this framework with a Deep Reinforcement Learning (DRL) agent powered by a Graphormer architecture, the authors achieve near-optimal processor allocation, significantly outperforming state-of-the-art heuristics.

What Problem Does This Paper Address?

Modern real-time systems—such as those powering autonomous driving, avionics, and industrial automation—rely on complex pipelines of intercommunicating sub-tasks. These systems are typically modeled as Directed Acyclic Graphs (DAGs), where nodes represent computational workloads and edges represent precedence constraints.

Example of a DAG task

Scheduling these DAGs onto multicore processors to guarantee they meet strict real-time deadlines while minimizing hardware costs (i.e., the number of processors used) is an NP-hard problem. Traditional list-scheduling heuristics rely on complex, dynamic priority queues at runtime, which often lead to pessimistic resource over-provisioning or high runtime overhead.

Methods

The authors flip the traditional scheduling paradigm on its head by introducing the concept of trivial schedulability. A DAG is "trivially schedulable" if its width (the maximum number of tasks that can run in parallel) is less than or equal to the number of available processors ($M$), and its length (the worst-case execution time of its longest path) is within the deadline ($D$). If these conditions are met, the tasks can be dispatched deterministically without needing complex priority queues.

To exploit this, the authors propose the Edge Generation Scheduling (EGS) framework. EGS starts with the original DAG and iteratively adds static dependencies (edges) offline to reduce the graph's width until it fits the processor count, ensuring the critical path length never exceeds the deadline.

To find the optimal edges to add, the process is modeled as a Markov Decision Process (MDP) solved via a DRL agent using Proximal Policy Optimization (PPO). The neural network architecture leverages Graphormer (a state-of-the-art graph transformer) to encode the structural properties of the DAG, utilizing transitive closure matrices to capture long-range reachability. To keep the $O(n^2)$ action space manageable, the authors implement four mathematical masks:

  • Redundancy mask: Prevents adding already existing transitively implied edges.
  • Cycle mask: Prevents invalid circular dependencies.
  • Length mask: Blocks edges that would push the critical path past the deadline.
  • Width mask: Restricts edge generation to nodes contributing to the maximum parallel width.

Datasets

The framework was evaluated using a synthetic dataset of 105,000 random DAG tasks generated via a standard method in real-time systems literature. The dataset systematically varies two key parameters:

  1. Task utilization: The total computational workload.
  2. Task density: The ratio of the DAG's critical path length to its deadline.

The graphs varied in size up to 140 nodes (with most falling between 10 and 80 nodes). The dataset was split into 60% training, 20% validation, and 20% testing.

Key Insights and Ideas

  • Restricting Parallelism Simplifies Execution: Counterintuitively, adding constraints (edges) to a graph offline makes online execution simpler and more predictable. It shifts the computational complexity from runtime dispatching to offline configuration.
  • Global Structural Awareness via Transformers: Standard Graph Convolutional Networks (GCNs) struggle with long-range dependencies. By using a Graph Transformer (Graphormer) and explicitly feeding it forward and backward reachability matrices, the DRL agent successfully learns how an edge added in one part of the graph globally impacts timing and parallelism elsewhere.
  • Action Masking as a Core Constraint: Pure reinforcement learning often struggles with combinatorial optimization due to sparse rewards. By embedding hard real-time scheduling theory directly into the action masks, the agent is physically blocked from making illegal moves, drastically accelerating training.

Key Results

  • Fewer Processors Required: The proposed EGS-PPO algorithm consistently outperformed state-of-the-art list scheduling heuristics (He2019, Zhao2020, He2021), successfully scheduling identical workloads with fewer processors.
  • Near-Optimal Performance: When compared against an exact Mixed-Integer Linear Programming (MILP) baseline on smaller graphs ($n \le 20$), EGS-PPO achieved an average optimality gap of just 1.78%, vastly outperforming competing heuristics which sat between 5.29% and 8.86%.
  • High-Density Excellence: The performance gains were most pronounced in high-density tasks (where the critical path is tight against the deadline). In these scenarios, EGS-PPO saved up to 5 to 8 processors compared to standard methods.

Limitations and Future Work

  • Single DAG Focus: The current framework is optimized for a single periodic DAG task. While it can be extended to multiple tasks via federated scheduling architectures, it does not natively optimize multi-DAG interleaving.
  • Homogeneous Hardware: The model assumes identical processors. Modern embedded systems increasingly rely on heterogeneous SoCs (e.g., big.LITTLE CPU clusters or GPU/NPU accelerators), which introduce varying execution times per node.
  • Future Directions: The authors plan to extend EGS to heterogeneous platforms and adapt the framework to minimize makespan (total completion time) rather than processor count, opening doors for cloud computing applications.

Summary updated

BibTeX
@article{sun2024edge,
  author = {Binqi Sun and Mirco Theile and Ziyuan Qin and Daniele Bernardini and Debayan Roy and Andrea Bastoni and Marco Caccamo},
  title = {{Edge Generation Scheduling for DAG Tasks Using Deep Reinforcement Learning}},
  journal = {IEEE Trans. Computers},
  year = {2024},
  doi = {10.1109/tc.2024.3350243},
}
Figure