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

MLGO:一个机器学习引导的机器学习优化框架

MLGO: a Machine Learning Guided Compiler Optimizations Framework

Google, Inc.(谷歌公司);Carnegie Mellon University(卡内基梅隆大学)

Mircea Trofin, Yundi Qian, Eugene Brevdo, Zinan Lin, Krzysztof Choromanski, David Li

摘要:

利用机器学习(ML)技术进行编译器优化已经在学术界得到了广泛的研究和探索。然而,ML在通用、行业实力编译器中的采用还没有发生。我们提出了MLGO,一个框架,系统地集成ML技术在工业编译器- LLVM。作为一个案例研究,我们提出了用机器学习模型取代LLVM中基于机器学习的内联大小优化的细节和结果。据我们所知,这项工作是ML在真实世界环境中复杂编译器通道中的第一次完全集成。它位于主LLVM存储库中。我们使用两种不同的ML算法:策略梯度和演化策略,训练内联的大小模型,并实现高达7\%的大小减少,相比,最先进的LLVM-Oz。在一个语料库上训练的同一个模型,可以很好地推广到现实世界的各种目标,以及经过几个月的积极开发后的同一组目标。训练模型的这种属性有利于在现实世界中部署ML技术。

英文摘要:

Leveraging machine-learning (ML) techniques for compiler optimizations has been widely studied and explored in academia. However, the adoption of ML in general-purpose, industry strength compilers has yet to happen. We propose MLGO, a framework for integrating ML techniques systematically in an industrial compiler -- LLVM. As a case study, we present the details and results of replacing the heuristics-based inlining-for-size optimization in LLVM with machine learned models. To the best of our knowledge, this work is the first full integration of ML in a complex compiler pass in a real-world setting. It is available in the main LLVM repository. We use two different ML algorithms: Policy Gradient and Evolution Strategies, to train the inlining-for-size model, and achieve up to 7\% size reduction, when compared to state of the art LLVM -Oz. The same model, trained on one corpus, generalizes well to a diversity of real-world targets, as well as to the same set of targets after months of active development. This property of the trained models is beneficial to deploy ML techniques in real-world settings.

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

↑