TL;DR
This paper introduces the Stealing Multi-Queue (SMQ), a priority scheduler that bridges the gap between theoretical rigor and practical performance. By combining the "power of choice" from randomized algorithms with cache-friendly techniques like queue affinity and task batching, SMQ outperforms state-of-the-art schedulers while providing provable guarantees on task ordering that significantly reduce wasted work.
What Problem Does This Paper Address?
In parallel computing, priority schedulers are the engines that drive algorithms like Dijkstra’s shortest path or mesh triangulation. Ideally, these schedulers should always pick the highest-priority task available. However, in a multi-threaded environment, maintaining a perfect global order creates a massive bottleneck.
To solve this, researchers use "relaxed" schedulers. There are two main camps:
- Theoretical (Multi-Queues): These use randomized strategies to provide "rank guarantees"—mathematical proof that the tasks picked aren't too far from the actual highest priority. Unfortunately, they are often slow in practice due to poor cache locality.
- Heuristic (e.g., Galois/OBIM): These are engineered for raw speed and cache efficiency but lack theoretical guarantees. This can lead to "wasted work," where threads process tasks out of order, realize the result is suboptimal, and have to re-process the same data later.
The authors ask: Can we design a scheduler that is as fast as the best heuristics but keeps the strong guarantees of randomized theory?
Methods
The authors propose the Stealing Multi-Queue (SMQ). It evolves the classic Multi-Queue (MQ) design through several key optimizations:
- Queue Affinity & Stealing: Instead of picking queues entirely at random (which kills cache performance), each thread is assigned a "local" queue. Most of the time, a thread works on its own tasks. However, with a specific probability ($p_{steal}$), it attempts to "steal" a higher-priority task from a random remote queue.
- Task Batching: To reduce the overhead of locking and synchronization, SMQ processes tasks in chunks (batches). This is common in standard task scheduling but rarely analyzed in the context of priority guarantees.
- NUMA-Awareness: The design accounts for modern hardware architecture by weighting the random selection to prefer queues on the same CPU socket, minimizing expensive cross-socket memory accesses.
- Theoretical Generalization: The authors provide a new mathematical analysis showing that even with these "local-first" relaxations, the scheduler still maintains $O(m)$ expected rank guarantees (where $m$ is the number of queues).
Datasets
The SMQ was evaluated using the Galois graph-processing framework on several large-scale real-world graphs:
- USA & WEST: Full and regional road networks of the United States.
- TWITTER: A directed graph of follower relations.
- WEB: A crawl of the
.sk(Slovakia) web domain.
These were tested across four classic algorithms: Single-Source Shortest Path (SSSP), Breadth-First Search (BFS), A* search, and Minimum Spanning Tree (MST).
Key Insights and Ideas
- The "Wasted Work" Connection: The most striking insight is that SMQ doesn't just win by being "faster" at moving bits; it wins by being "smarter." Because it has better rank guarantees than heuristics like OBIM, it executes significantly fewer total tasks to reach the same result.
- Locality vs. Randomness: The paper proves that you don't need total randomness to get the benefits of randomized load balancing. "Biased" randomness (preferring local queues) is sufficient to maintain theoretical bounds while drastically improving cache hits.
- The Power of Choice Still Holds: Even when tasks are stolen in batches and threads are scheduled unfairly, the "power of two choices" (comparing a local task to a random remote one) remains a robust way to keep the system near the global optimum.
Key Results
- Performance: SMQ outperformed state-of-the-art schedulers like OBIM and PMOD by up to 1.84x on SSSP and A* benchmarks.
- Efficiency: On the USA road network, SMQ showed a much lower "work increase" (wasted tasks) compared to heuristics, proving that its analytical guarantees translate directly to saved CPU cycles.
- Scalability: The implementation scales effectively up to 256 hardware threads on AMD EPYC systems and 128 threads on Intel Xeon systems.
- Robustness: The performance remained stable across a wide range of parameters (stealing probability and batch size), suggesting it doesn't require exhaustive "magic number" tuning for every new hardware setup.
Limitations and Future Work
- High-Expansion Graphs: On social network graphs (like Twitter) using BFS, SMQ was slightly slower than OBIM. In these "flat" priority scenarios, the overhead of maintaining a heap-based local queue outweighs the benefits of better task ordering.
- Future Directions: The authors suggest exploring SMQ in other domains beyond graph processing, such as iterative machine learning algorithms, where priority-based updates are common. They also aim to compare SMQ against more complex "work-efficient bucketing" frameworks.
Summary updated