Customized Monte Carlo Tree Search for LLVM/Polly's Composable Loop Optimization Transformations

Jaehoon Koo, Prasanna Balaprakash, Michael Kruse, Xingfu Wu, Paul Hovland, Mary Hall

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

5 Scopus citations

Abstract

Polly is the LLVM project's polyhedral loop optimizer. Recent user-directed loop transformation pragmas were proposed based on LLVM/Clang and Polly. The search space exposed by the transformation pragmas is a tree, wherein each node represents a specific combination of loop transformations that can be applied to the code resulting from the parent node's loop transformations. To find the best combination of these loop transformations, we have developed a search algorithm based on Monte Carlo tree search (MCTS). The algorithm consists of two phases: exploring loop transformations at different depths of the tree to identify promising regions in the tree search space and exploiting those regions by performing a local search. Moreover, a restart mechanism is used to avoid the MCTS getting trapped in a local solution. The best and worst solutions are transferred from the previous phases of the restarts to leverage the search history. We compare our approach with breadth-first, beam, global greedy, and random search methods using PolyBench benchmarks and ECP proxy applications. Experimental results show that our MCTS algorithm finds pragma combinations with a speedup of 2.3x over Polly's heuristic optimizations on average.

Original languageEnglish
Title of host publicationProceedings of PMBS 2021
Subtitle of host publicationPerformance Modeling, Benchmarking and Simulation of High Performance Computer Systems, Held in conjunction with SC 2021: The International Conference for High Performance Computing, Networking, Storage and Analysis
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages82-93
Number of pages12
ISBN (Electronic)9781665411189
DOIs
StatePublished - 2021
Externally publishedYes
Event12th International Workshop on Performance Modeling, Benchmarking and Simulation of High Performance Computer Systems, PMBS 2021 - St. Louis, United States
Duration: Nov 15 2021 → …

Publication series

NameProceedings of PMBS 2021: Performance Modeling, Benchmarking and Simulation of High Performance Computer Systems, Held in conjunction with SC 2021: The International Conference for High Performance Computing, Networking, Storage and Analysis

Conference

Conference12th International Workshop on Performance Modeling, Benchmarking and Simulation of High Performance Computer Systems, PMBS 2021
Country/TerritoryUnited States
CitySt. Louis
Period11/15/21 → …

Funding

This research was supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of the U.S. Department of Energy Office of Science and the National Nuclear Security Administration.

Keywords

  • Clang
  • Polly
  • autotuning
  • loop optimization

Fingerprint

Dive into the research topics of 'Customized Monte Carlo Tree Search for LLVM/Polly's Composable Loop Optimization Transformations'. Together they form a unique fingerprint.

Cite this