当前位置: X-MOL 学术arXiv.cs.PF › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Customized Monte Carlo Tree Search for LLVM/Polly's Composable Loop Optimization Transformations
arXiv - CS - Performance Pub Date : 2021-05-10 , DOI: arxiv-2105.04555
Jaehoon Koo, Prasanna Balaprakash, Michael Kruse, Xingfu Wu, Paul Hovland, Mary Hall

Polly is the LLVM project's polyhedral loop nest optimizer. Recently, 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. We have developed a search algorithm based on Monte Carlo tree search (MCTS) to find the best combination of loop transformations. Our 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 random, greedy, and breadth-first search methods on PolyBench kernels 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.

中文翻译:

定制的蒙特卡洛树搜索,用于LLVM / Polly的可组合循环优化转换

Polly是LLVM项目的多面循环嵌套优化器。最近,基于LLVM / Clang和Polly提出了用户控制的循环转换实用程序。转换实用程序公开的搜索空间是一棵树,其中每个节点代表循环转换的特定组合,可以将其应用于父节点的循环转换产生的代码。我们已经开发了一种基于蒙特卡罗树搜索(MCTS)的搜索算法,以找到循环变换的最佳组合。我们的算法包括两个阶段:探索树的不同深度处的循环变换以识别树搜索空间中有希望的区域,并通过执行局部搜索来利用这些区域。此外,使用重新启动机制来避免将MCTS困在本地解决方案中。最佳和最差的解决方案是从重新启动的先前阶段转移来的,以利用搜索历史记录。我们将我们的方法与PolyBench内核和ECP代理应用程序上的随机,贪婪和广度优先搜索方法进行了比较。实验结果表明,相对于Polly的启发式优化算法,我们的MCTS算法能够以2.3倍的速度找到实用的组合。
更新日期:2021-05-12
down
wechat
bug