LLVM/Polly组合循环优化变换的定制蒙特卡罗树搜索
Customized Monte Carlo Tree Search for LLVM/Polly's Composable Loop Optimization Transformations
摘要:
Polly是LLVM项目的多面体循环嵌套优化器。最近,基于LLVM/Clang和Polly提出了用户导向的循环转换杂注。由变换杂注暴露的搜索空间是树,其中每个节点表示可应用于从父节点的循环变换得到的代码的循环变换的特定组合。我们已经开发了一种基于蒙特卡罗树搜索(MCTS)的搜索算法,以找到最佳的循环变换组合。我们的算法包括两个阶段:探索循环变换在树的不同深度,以确定有前途的地区在树搜索空间和利用这些地区进行局部搜索。此外,重新启动机制被用来避免MCTS陷入局部解决方案。最佳和最差解决方案从重新启动的前一阶段转移,以利用搜索历史。我们比较我们的方法与随机,贪婪,广度优先搜索方法的PolyBench内核和ECP代理应用程序。实验结果表明,我们的MCTS算法发现杂注组合的平均加速比为2.3倍波利的启发式优化。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。