Customized Monte Carlo tree search for LLVM/Polly's composable loop optimization transformations

J Koo, P Balaprakash, M Kruse, X Wu… - … and Simulation of …, 2021 - ieeexplore.ieee.org
2021 International Workshop on Performance Modeling, Benchmarking …, 2021ieeexplore.ieee.org
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 …
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.
ieeexplore.ieee.org
Showing the best result for this search. See all results