arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2003.00671cs.DCcs.LGcs.PL
收藏

AutoPhase:在随机森林中使用深度强化学习来处理HLS相位排序

AutoPhase: Juggling HLS Phase Orderings in Random Forests with Deep Reinforcement Learning

University of California, Berkeley(加州大学伯克利分校);Massachusetts Institute of Technology(麻省理工学院)

Qijing Huang, Ameer Haj-Ali, William Moses, John Xiang, Ion Stoica, Krste Asanovic, John Wawrzynek

摘要:

编译器生成的代码的性能取决于它应用优化过程的顺序。选择一个好的顺序-通常被称为相位排序问题,是一个NP难题。因此,现有的解决方案依赖于各种不同的方法。在本文中,我们评估了一种解决相位排序问题的新技术:深度强化学习。为此,我们实现了AutoPhase:一个框架,它采用程序并使用深度强化学习来找到一系列编译通道,以最大限度地减少其执行时间。不失一般性,我们在LLVM编译器工具链和目标高级合成程序的背景下构建了这个框架。我们使用随机森林来量化给定通道的有效性与程序特征之间的相关性。这有助于我们减少搜索空间,避免相位排序,不太可能提高给定程序的性能。我们将AutoPhase的性能与解决相位排序问题的最先进算法进行了比较。在我们的评估中,我们表明,与使用-O3编译器标志相比,AutoPhase将电路性能提高了28%,并且与最先进的解决方案相比,实现了具有竞争力的结果,同时需要更少的样本。此外,与现有的最先进的解决方案不同,我们的深度强化学习解决方案在对100个随机生成的程序进行训练后,在推广到真实基准和12,874个不同的随机生成程序方面表现出了良好的效果。

英文摘要:

The performance of the code a compiler generates depends on the order in which it applies the optimization passes. Choosing a good order--often referred to as the phase-ordering problem, is an NP-hard problem. As a result, existing solutions rely on a variety of heuristics. In this paper, we evaluate a new technique to address the phase-ordering problem: deep reinforcement learning. To this end, we implement AutoPhase: a framework that takes a program and uses deep reinforcement learning to find a sequence of compilation passes that minimizes its execution time. Without loss of generality, we construct this framework in the context of the LLVM compiler toolchain and target high-level synthesis programs. We use random forests to quantify the correlation between the effectiveness of a given pass and the program's features. This helps us reduce the search space by avoiding phase orderings that are unlikely to improve the performance of a given program. We compare the performance of AutoPhase to state-of-the-art algorithms that address the phase-ordering problem. In our evaluation, we show that AutoPhase improves circuit performance by 28% when compared to using the -O3 compiler flag, and achieves competitive results compared to the state-of-the-art solutions, while requiring fewer samples. Furthermore, unlike existing state-of-the-art solutions, our deep reinforcement learning solution shows promising result in generalizing to real benchmarks and 12,874 different randomly generated programs, after training on a hundred randomly generated programs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑