arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.05104cs.PLcs.AIcs.LG
收藏

使用Coreset和归一化值预测学习机器人通过顺序

Learning Compiler Pass Orders using Coreset and Normalized Value Prediction

University of California, San Diego(加州大学圣地亚哥分校);Meta AI

Youwei Liang, Kevin Stone, Ali Shameli, Chris Cummins, Mostafa Elhoushi, Jiadong Guo, Benoit Steiner, Xiaomeng Yang, Pengtao Xie, Hugh Leather, Yuandong Tian

摘要:

找到编译的最佳传递序列可以导致程序大小的显著减小和/或程序效率的提高。关于编译遍次排序的先前工作具有两个主要缺点。它们要么在编译时需要过多的预算(就编译步骤而言),要么无法推广到看不见的程序。在本文中,对于代码大小减少任务,我们提出了一种新的管道,在45个编译调用内找到程序相关的传递序列。该算法首先通过子模函数的贪婪优化确定一个包含50个遍序列的核心集,然后利用图神经网络(GNN)学习策略,通过预测核心集中遍序列的归一化值来选择最优序列。尽管它很简单,但我们的管道在来自14个数据集的不同领域的大量(4683)看不见的代码存储库中平均比默认的-Oz标志高出4.7%。相比之下,以前的方法,如在原始通道序列空间上的强化学习,由于稀疏的奖励,可能需要几天的训练时间,并且可能无法很好地推广来自不同领域的保持。我们的研究结果表明,现有的人类设计的编译器标志,可以改善一个简单而有效的技术,将原始的动作空间转换成一个小的密集的奖励。

英文摘要:

Finding the optimal pass sequence of compilation can lead to a significant reduction in program size and/or improvement in program efficiency. Prior works on compilation pass ordering have two major drawbacks. They either require an excessive budget (in terms of compilation steps) at compile time or fail to generalize to unseen programs. In this paper, for code-size reduction tasks, we propose a novel pipeline to find program-dependent pass sequences within 45 compilation calls. It first identifies a coreset of 50 pass sequences via greedy optimization of a submodular function, and then learns a policy with Graph Neural Network (GNN) to pick the optimal sequence by predicting the normalized values of the pass sequences in the coreset. Despite its simplicity, our pipeline outperforms the default -Oz flag by an average of 4.7% over a large collection (4683) of unseen code repositories from diverse domains across 14 datasets. In comparison, previous approaches like reinforcement learning on the raw pass sequence space may take days to train due to sparse reward, and may not generalize well in held-out ones from different domains. Our results demonstrate that existing human-designed compiler flags can be improved with a simple yet effective technique that transforms the raw action space into a small one with denser rewards.

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

↑