arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2008.08951cs.LGstat.ML
收藏

基于深度强化学习的静态神经网络优化

Static Neural Compiler Optimization via Deep Reinforcement Learning

Technische Universität Darmstadt Graduate School of Excellence Computational Engineering(达姆施塔特工业大学卓越计算工程研究生院);Iowa State University Department of Computer Science(爱荷华州立大学计算机科学系);Technische Universität Darmstadt Department of Computer Science(达姆施塔特工业大学计算机科学系)

Rahim Mammadli, Ali Jannesari, Felix Wolf

摘要:

现代编译器的阶段排序问题多年来一直受到研究界的关注,但在很大程度上仍未解决。向用户公开的各种优化序列由编译器开发人员手动设计。在设计这样的序列时,开发人员必须选择优化通道的集合、它们的参数和序列内的顺序。结果序列通常达不到给定源代码的最佳运行时,有时甚至会降低性能,与未优化的版本相比。在本文中,我们采用深度强化学习方法来解决相位排序问题。提供构成LLVM的O3序列的子序列,我们的代理学习在用于训练的源代码集上优于O3序列,并在验证集上实现有竞争力的性能,在以前从未见过的程序上获得高达1.32倍的加速。值得注意的是,我们的方法不同于自动调优方法,不依赖于一个或多个测试运行的程序,使成功的优化决策。它不依赖于任何动态特性,而只依赖于源代码的静态可达中间表示。我们相信,使用我们的方法训练的模型可以作为神经优化代理集成到现代编译器中,首先补充并最终取代手工制作的优化序列。

英文摘要:

The phase-ordering problem of modern compilers has received a lot of attention from the research community over the years, yet remains largely unsolved. Various optimization sequences exposed to the user are manually designed by compiler developers. In designing such a sequence developers have to choose the set of optimization passes, their parameters and ordering within a sequence. Resulting sequences usually fall short of achieving optimal runtime for a given source code and may sometimes even degrade the performance when compared to unoptimized version. In this paper, we employ a deep reinforcement learning approach to the phase-ordering problem. Provided with sub-sequences constituting LLVM's O3 sequence, our agent learns to outperform the O3 sequence on the set of source codes used for training and achieves competitive performance on the validation set, gaining up to 1.32x speedup on previously-unseen programs. Notably, our approach differs from autotuning methods by not depending on one or more test runs of the program for making successful optimization decisions. It has no dependence on any dynamic feature, but only on the statically-attainable intermediate representation of the source code. We believe that the models trained using our approach can be integrated into modern compilers as neural optimization agents, at first to complement, and eventually replace the hand-crafted optimization sequences.

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

↑