Skip to main content
QUICK REVIEW

[Paper Review] ProTuner: Tuning Programs with Monte Carlo Tree Search

Ameer Haj-Ali|arXiv (Cornell University)|May 27, 2020
Machine Learning and AlgorithmsComputer Science47 references7 citations
TL;DR

ProTuner proposes using Monte Carlo Tree Search (MCTS) to automatically tune Halide programs for high-performance deep learning and image processing workloads. By formulating scheduling as a Markov Decision Process and leveraging MCTS with Upper Confidence Bound (UCB) for lookahead and long-term reward estimation, ProTuner outperforms beam search, achieving up to 3.25× better performance on 16 real benchmarks while being more resilient to cost model noise.

ABSTRACT

We explore applying the Monte Carlo Tree Search (MCTS) algorithm in a notoriously difficult task: tuning programs for high-performance deep learning and image processing. We build our framework on top of Halide and show that MCTS can outperform the state-of-the-art beam-search algorithm. Unlike beam search, which is guided by greedy intermediate performance comparisons between partial and less meaningful schedules, MCTS compares complete schedules and looks ahead before making any intermediate scheduling decision. We further explore modifications to the standard MCTS algorithm as well as combining real execution time measurements with the cost model. Our results show that MCTS can outperform beam search on a suite of 16 real benchmarks.

Motivation & Objective

  • To address the challenge of automatic program scheduling in deep learning and image processing workloads, where manual tuning is costly and heuristics often fail to find optimal schedules.
  • To overcome the limitations of beam search—its greediness and reliance on noisy intermediate performance estimates—by using a more robust, lookahead-based search strategy.
  • To explore the feasibility and effectiveness of applying MCTS with UCB to the program scheduling problem as a Markov Decision Process (MDP).
  • To evaluate the impact of combining learned cost models with real execution time measurements in improving scheduling performance.
  • To identify and address performance bottlenecks in MCTS, such as high child enumeration overhead and overfitting to cost models.

Proposed method

  • Formulate the Halide scheduling problem as a Markov Decision Process (MDP), where states represent intermediate schedules and actions are scheduling optimizations (e.g., tiling, vectorization, fusion).
  • Apply Monte Carlo Tree Search (MCTS) with Upper Confidence Bound (UCB) to balance exploration and exploitation in the search tree, enabling lookahead and long-term reward estimation.
  • Use simulation-based rollouts to evaluate complete schedules, avoiding reliance on intermediate performance predictions that are prone to error.
  • Integrate real execution time measurements with a learned cost model to improve search accuracy and reduce overfitting to model inaccuracies.
  • Optimize MCTS performance by tuning the exploration hyperparameter $C_p$ and reducing redundant child enumeration during simulation.
  • Rebuild the search tree iteratively with a new root after each decision, enabling adaptive and dynamic scheduling exploration.

Experimental results

Research questions

  • RQ1Can MCTS with UCB outperform beam search in finding high-performance Halide schedules for deep learning and image processing workloads?
  • RQ2Does lookahead via complete schedule simulation in MCTS reduce the impact of noisy or inaccurate cost models compared to beam search?
  • RQ3How does combining real execution time measurements with a learned cost model affect the performance and robustness of the auto-tuning process?
  • RQ4What are the key performance bottlenecks in MCTS-based auto-tuning, and how can they be mitigated?
  • RQ5Can dynamic tuning of the exploration parameter $C_p$ across different programs and search depths improve MCTS efficiency and effectiveness?

Key findings

  • ProTuner with MCTS outperforms beam search on all 16 real benchmarks evaluated, achieving up to 3.25× better performance.
  • The use of complete schedule simulation in MCTS reduces the impact of noisy intermediate cost estimates, making the search more robust than beam search.
  • Combining real execution time measurements with the learned cost model further improves performance, demonstrating the value of hybrid evaluation.
  • The current MCTS implementation incurs a 7.5% cost evaluation overhead, with 88% of time spent enumerating unused children, indicating a potential 8× performance improvement through optimization.
  • Overfitting to the cost model occurs when MCTS runs for too long, suggesting a need for early stopping or adaptive search termination.
  • Tuning $C_p$ dynamically across programs and search depths could improve exploration efficiency, especially in shorter-running programs with lower variance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.