Instruction scheduling using MAX-MIN ant system optimization

Gang Wang, Wenrui Gong, Ryan Kastner2005

TL;DR

This paper introduces a novel instruction scheduling algorithm that combines the MAX-MIN Ant System (MMAS) meta-heuristic with traditional list scheduling. By dynamically adjusting local and global heuristics and leveraging a cooperative search strategy, the algorithm achieves near-optimal instruction schedules with improved stability and performance compared to existing methods.

What Problem Does This Paper Address?

Modern computing systems are increasingly complex, featuring more processing units. Effectively mapping application instructions onto these resources to minimize execution time is crucial for realizing their full potential. This task, known as instruction scheduling (IS), is an NP-hard problem. Existing heuristic methods like list scheduling and force-directed scheduling offer solutions but often struggle with finding optimal schedules or exhibit performance sensitive to the input application's structure. The paper aims to address this by developing a more robust and effective instruction scheduling algorithm.

Methods

The core of the proposed solution is a hybrid approach that integrates the MAX-MIN Ant System (MMAS) optimization algorithm with list scheduling. Here's a breakdown:

  • Ant System Meta-Heuristic: Inspired by the foraging behavior of ants, the algorithm uses a population of "ants" to explore the solution space. Each ant constructs a potential instruction schedule by creating a priority list of instructions.
  • Dynamic Heuristics: A key innovation is the dynamic adjustment of both local and global heuristics.
  • Local Heuristics: These guide an ant's immediate decision-making. The paper explores several standard heuristics like Instruction Mobility (IM), Instruction Depth (ID), Latency Weighted Instruction Depth (LWID), and Successor Number (SN). Crucially, the algorithm dynamically updates the "deadline" used to compute instruction mobility, leading to tighter and more effective guidance.
  • Global Heuristics (Pheromone Trails): These represent the collective experience of the ant colony, indicating the "favorableness" of assigning an instruction to a particular position in the priority list.
  • MAX-MIN Ant System (MMAS): This variant of the Ant System is used to prevent premature convergence to local optima. MMAS dynamically bounds the pheromone trails, ensuring that even less-explored paths have a chance to be selected, thus encouraging broader exploration of the search space.
  • List Scheduling Integration: After ants construct their priority lists, these lists are fed into a traditional list scheduler to evaluate the quality of the resulting schedule (its latency). This evaluation then provides feedback to the ants for updating their heuristics and pheromone trails.
  • Iterative Improvement: The entire process is iterative. The algorithm repeats the ant-based search and list scheduling evaluation multiple times, refining the heuristics and pheromone trails with each iteration to converge towards better solutions.

Datasets

The paper evaluates its algorithm on several benchmark instruction scheduling tasks. These benchmarks are derived from real-world applications and include:

  • AR Filter
  • Elliptic Wave Filter
  • Two implementations of the Cosine function
  • Two FIR filters
  • A second-order differential equation implementation

These benchmarks vary in size, ranging from 21 to 82 nodes in their Data Flow Graphs (DFGs). The authors also mention using the MediaBench benchmark suite for analyzing DFG size distributions, noting that the majority of practical DFGs are relatively small.

Key Insights and Ideas

  • Hybridization is Powerful: Combining the global search capabilities of ant systems with the structured execution of list scheduling proves to be more effective than either method alone.
  • Dynamic Heuristics Matter: Dynamically adjusting heuristics, particularly instruction mobility based on the best schedule found so far, significantly improves the guidance provided to the ants.
  • MMAS Prevents Stagnation: The MAX-MIN variant of the Ant System is crucial for maintaining exploration and avoiding getting stuck in suboptimal solutions, especially for larger and more complex problems.
  • Stability is a Major Win: The algorithm demonstrates remarkable stability across different input applications and variations in local heuristics, a critical factor for practical deployment. This is attributed to the balanced exploration strategy and iterative refinement.
  • Near-Optimal Solutions: The algorithm consistently achieves schedules very close to optimal, often outperforming established methods and even outperforming ILP solvers when they run out of resources.

Key Results

The MMAS-IS algorithm consistently outperformed traditional list scheduling heuristics and force-directed scheduling across all tested benchmarks.

  • Performance Improvement: On average, the proposed algorithm provided a 6.2% performance enhancement compared to force-directed scheduling, with individual improvements reaching up to 14.7%.
  • Near-Optimality: Compared to optimal scheduling results obtained via Integer Linear Programming (ILP), the MMAS-IS algorithm achieved schedules that were significantly closer to the optimum, improving average schedule latency by 44% over list scheduling heuristics.
  • Stability: The algorithm exhibited much greater stability, with a significantly smaller standard deviation in results (0.1673) compared to list scheduling (0.8128) across different heuristics and benchmarks.
  • Runtime: While list scheduling was the fastest due to its one-pass nature, the MMAS-IS algorithm's runtime was competitive, ranging from 0.1 to 1.76 seconds. For larger benchmarks, it even outperformed the force-directed scheduler.

Limitations and Future Work

  • ILP Solver Limitations: The paper notes that for very large DFGs (like COSINE1 and COSINE2), the ILP solver (CPLEX) failed to provide final results due to memory constraints, highlighting the necessity of heuristic approaches.
  • Fixed Iterations: The current implementation uses a fixed number of iterations for the ants. Future work could explore adaptive stopping criteria.
  • Exploration of Other Heuristics: While the paper explored several local heuristics, further investigation into other or novel heuristics could yield even better results.
  • Adaptive Parameter Tuning: The paper mentions parameters like pbest and ρ (evaporation ratio). Investigating adaptive methods for tuning these parameters could further enhance performance.
  • Parallelization: The ant colony approach is inherently parallelizable, and exploring parallel implementations could significantly speed up the scheduling process.

Summary updated

BibTeX
@misc{wang2005instruction,
  author = {Gang Wang and Wenrui Gong and Ryan Kastner},
  title = {{Instruction scheduling using <i>MAX-MIN</i> ant system optimization}},
  year = {2005},
  doi = {10.1145/1057661.1057674},
}
Figure