Optimizing Workflow Task Clustering Using Reinforcement Learning

Chin Poh Leong, Chee Sun Liew, Chee Seng Chan, Muhammad Habib Ur RehmanIEEE Access 2021

Introduction

Scientific workflows in domains such as astronomy, genomics, and high-energy physics often comprise thousands of fine-grained computational tasks. While this modularity aids in design and portability, it introduces significant execution challenges. When individual tasks have execution times in the millisecond range but scheduling systems require seconds to manage them, the resulting "scheduling overhead" becomes a dominant bottleneck, severely degrading performance.

The Task Clustering Challenge

To mitigate overhead, researchers employ task clustering, which groups multiple small tasks into a single larger job. However, determining the optimal degree of clustering presents a "Goldilocks" problem: clustering too few tasks leaves the system buried in overhead, while clustering too many reduces parallel processing opportunities and increases the risk of resource idling.

Traditionally, finding the "just right" number of clusters requires manual tuning by human experts for every specific workflow and hardware configuration. This paper proposes an automated approach using Reinforcement Learning (RL) to discover these optimal configurations dynamically.

Comparison of original workflow structures versus horizontal clustering strategies using cluster size and cluster number.

Methodology: A Q-Learning Approach

The authors frame the clustering optimization problem as a Markov Decision Process (MDP) and implement a Q-learning agent to navigate the search space.

Key Technical Components:

  • State Space: Unlike many optimization models that use execution time (makespan) as a state, this model uses the cluster number itself. The authors argue that makespan is too stochastic and "noisy" due to network fluctuations, making it an unreliable state indicator.
  • Action Space: The agent's actions consist of adjusting the number of clusters for subsequent workflow executions.
  • Reward Function: To drive performance, the environment utilizes "provenance records" (historical execution logs). A positive reward (+1) is granted if the current execution is faster than the 10th percentile of previous runs; otherwise, a punishment (-1) is applied. This percentile-based benchmark forces the agent to seek peak performance rather than just average results.
  • The Learning Loop: The agent interacts with a Workflow Management System (WMS) like Pegasus. It selects a cluster number, the WMS executes the workflow, and the resulting makespan is used to calculate the reward and update the agent’s Q-table.

Experimental Evaluation

The model was evaluated using the Montage workflow, a standard astronomy application for creating sky mosaics. Testing occurred across two environments:

  1. Real-world Testbed: A physical cluster at the Universiti Malaya Data-Intensive Computing Centre (DICC) using the Pegasus WMS.
  2. Scale-up Simulation: Using WorkflowSim, the researchers simulated a 1000-node Montage template to evaluate the agent’s performance in larger state spaces (up to 100 possible cluster numbers).

Key Insights and Results

  • Automated Expertise: The RL agent successfully identified that a cluster number of 9 or 10 yielded the lowest makespan for the physical Montage workload—matching the "intuition" that an experienced researcher would typically find through manual trial and error.
  • Convergence and Efficiency: In the 1000-task simulation, over 97% of the agent's preferred states fell within the optimal range (2 to 11 clusters) after training. The agent demonstrated the ability to terminate episodes early with positive rewards, indicating it can find high-quality configurations without exhaustive searching.
  • Robustness to Stochasticity: By focusing on the 10th percentile for rewards, the system effectively filtered out the inherent randomness of network lag and resource contention in high-performance computing (HPC) environments.

Conclusion and Future Work

This research demonstrates that Reinforcement Learning can effectively automate the complex task of workflow mapping. By optimizing the clustering phase before tasks reach the scheduler, the system significantly reduces execution overhead.

While Q-learning proved effective for these tests, its reliance on a Q-table limits scalability as HPC environments grow to millions of CPUs. Future research will explore Deep Reinforcement Learning (DQN) and Actor-Critic models to handle more complex state spaces and diverse hardware architectures.

Summary updated

BibTeX
@article{leong2021optimizing,
  author = {Chin Poh Leong and Chee Sun Liew and Chee Seng Chan and Muhammad Habib Ur Rehman},
  title = {{Optimizing Workflow Task Clustering Using Reinforcement Learning}},
  journal = {IEEE Access},
  year = {2021},
  doi = {10.1109/access.2021.3101454},
}
Figure