TL;DR
This paper introduces a novel reinforcement learning (RL) approach for dynamic DAG scheduling, using graph neural networks to adaptively represent scheduling problems on the fly. Their method achieves competitive performance with state-of-the-art heuristics for Cholesky factorization, demonstrating flexibility and transfer learning capabilities.
What Problem Does This Paper Address?
Many real-world applications, particularly in high-performance computing (HPC), involve complex optimization problems characterized by uncertainty, non-determinism, and dynamic changes. A prime example is task scheduling, where the exact duration of tasks and communication times can be unpredictable, and the full set of tasks might not be known in advance. Traditional static scheduling methods, which pre-plan task assignments, struggle with these dynamic environments. While reinforcement learning (RL) is well-suited for sequential decision-making under uncertainty, applying it effectively to complex combinatorial optimization problems like dynamic DAG scheduling has remained a significant challenge. This paper aims to bridge this gap by developing an RL agent capable of dynamic DAG scheduling that can adapt to changing conditions and generalize to unseen scenarios.
Methods
The authors propose a dynamic DAG scheduling approach using a combination of deep reinforcement learning and graph neural networks (GNNs).
- Markov Decision Process (MDP) Formulation: The dynamic DAG scheduling problem is formalized as an MDP, defining states, actions, transition probabilities, and rewards.
- State Representation: The state is represented by a sub-DAG, focusing on running tasks, available tasks, and their descendants within a defined window
w. Node features include successor/predecessor counts, task type, availability, running status, and critical path information. - Graph Neural Networks (GNNs): To process the graph-structured state, they employ stacked graph convolution layers. These layers allow nodes to exchange information, creating an internal representation (embedding) of the sub-DAG. This is a key innovation for adapting to the problem's structure.
- Actor-Critic Algorithm (A2C): The RL agent uses an Actor-Critic (A2C) architecture. The "actor" (policy network) learns to select actions (scheduling a task or passing), while the "critic" (value network) estimates the value of states to reduce variance in training.
- Dynamic Scheduling: The scheduling process is iterative. At runtime, the agent selects an available task to schedule on a processor. The system state updates as tasks complete, and the agent makes new decisions. This contrasts with static scheduling, where all decisions are made upfront.
- Reward Function: The reward is given only at the end of the scheduling process, based on the final makespan (total execution time). This makespan is normalized by a baseline heuristic (ASAP) to encourage improvement.
Datasets
The paper uses a simulated model of the Cholesky factorization task graph. They generate DAGs for different numbers of tiles (T=4, 8, 16) and evaluate performance on systems with varying numbers of processing units (p=2, 4, 6, 8). Task durations are based on data from a previous study on GPU computations.
Key Insights and Ideas
- GNNs for Dynamic Graph Representation: Using GNNs to build an adaptive, on-the-fly representation of the problem state (the sub-DAG) is crucial for the RL agent to understand and react to the dynamic scheduling environment.
- Flexibility over Static Optimality: The dynamic nature of the RL approach allows it to handle situations where static scheduling would fail, such as when task durations are uncertain or the full DAG is not known upfront.
- Transfer Learning Potential: The RL agent demonstrates the ability to generalize its learned scheduling policy to different problem instances (different DAG sizes and numbers of processors) without retraining, a significant advantage over many heuristic methods.
- Value of Critical Path Information: Including the critical path information in node embeddings significantly improves performance, highlighting the importance of structural graph properties for scheduling decisions. However, the agent can still perform reasonably well even without this information, albeit with more training.
Key Results
- Competitive Performance: The proposed RL approach achieves makespans that are competitive with, and often outperform, state-of-the-art heuristics like ASAP, Greedy, and Random baselines, especially for larger DAGs. For instance, with
T=16andp=4, the RL agent achieved a makespan of 792, compared to ASAP's 787. - Effective Transfer Learning: When trained on a specific DAG size (
T=8) and number of processors (p=4), the agent's learned policy achieved makespans only slightly worse than a dedicated agent when tested on different DAG sizes (T=4, 16) or processor counts (p=2, 6, 8). For example, training onT=8, p=4and testing onT=16, p=4resulted in a makespan of 792, compared to a dedicated agent's 792. - Window Size Impact: The study found that a window size
w=0(using only immediate neighbors) was almost optimal when critical path information was included in the embedding. Without critical path information, increasingwimproved performance and stabilized training. - Computational Overhead: The inference time per action increases with the size of the DAG and the window size
w, due to more message-passing in GNN computations. However, this overhead is manageable for practical applications.
Limitations and Future Work
- Homogeneous Resources: The current work focuses on homogeneous computing resources. The authors suggest extending the approach to heterogeneous environments (CPUs and GPUs) as a future direction.
- Task Types: The experiments were conducted on Cholesky factorization. Investigating other task types, like LU factorization, which involves more complex dependencies (e.g., pivot selection), is also proposed.
- Integration into Runtime Systems: A key future step is to integrate the developed RL approach into actual runtime systems to demonstrate its practical utility in real-world HPC applications.
- Stochastic Durations: While the method is designed to handle stochastic durations, the experiments primarily used deterministic task durations for simplicity. Further exploration of its performance with truly stochastic task durations would be valuable.
Summary updated