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

学习超级优化程序

Learning to superoptimize programs

University of Oxford(牛津大学);Alan Turing Institute(艾伦·图灵研究所);Microsoft Research(微软研究院)

Rudy Bunel, Alban Desmaison, M. Pawan Kumar, Philip H. S. Torr, Pushmeet Kohli

摘要:

代码超级优化是将任何给定程序转换为更有效的版本,同时保留其输入输出行为的任务。在某种意义上,它类似于自然语言处理中的释义问题,其目的是改变话语的语法而不改变其语义。代码优化已经成为多年研究的主题,这导致了编译器使用的基于规则的转换策略的发展。然而,最近,一类基于随机搜索的方法已被证明优于这些策略。这种方法涉及对提案分发中的程序修改进行重复采样,根据它们是否保持正确性以及它们实现的改进来接受或拒绝这些修改。然而,这些方法既不从过去的行为中学习,也不试图利用所考虑的程序的语义。出于这种观察,我们提出了一种新的基于学习的代码超优化方法。直观地说,我们的方法通过使用预期改进的梯度的无偏估计来学习提案分布。包括自动生成的基准测试以及现有的(“黑客的喜悦”)程序的实验表明,所提出的方法是能够显着优于最先进的方法代码超优化。

英文摘要:

Code super-optimization is the task of transforming any given program to a more efficient version while preserving its input-output behaviour. In some sense, it is similar to the paraphrase problem from natural language processing where the intention is to change the syntax of an utterance without changing its semantics. Code-optimization has been the subject of years of research that has resulted in the development of rule-based transformation strategies that are used by compilers. More recently, however, a class of stochastic search based methods have been shown to outperform these strategies. This approach involves repeated sampling of modifications to the program from a proposal distribution, which are accepted or rejected based on whether they preserve correctness, and the improvement they achieve. These methods, however, neither learn from past behaviour nor do they try to leverage the semantics of the program under consideration. Motivated by this observation, we present a novel learning based approach for code super-optimization. Intuitively, our method works by learning the proposal distribution using unbiased estimators of the gradient of the expected improvement. Experiments on benchmarks comprising of automatically generated as well as existing ("Hacker's Delight") programs show that the proposed method is able to significantly outperform state of the art approaches for code super-optimization.

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

↑