MLGO: a Machine Learning Guided Compiler Optimizations Framework

01/13/2021
by   Mircea Trofin, et al.
27

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.

READ FULL TEXT
research
03/29/2019

SysML: The New Frontier of Machine Learning Systems

Machine learning (ML) techniques are enjoying rapidly increasing adoptio...
research
03/10/2020

Managing Data Lineage of O G Machine Learning Models: The Sweet Spot for Shale Use Case

Machine Learning (ML) has increased its role, becoming essential in seve...
research
01/30/2023

Operator Fusion in XLA: Analysis and Evaluation

Machine learning (ML) compilers are an active area of research because t...
research
02/22/2017

When Lempel-Ziv-Welch Meets Machine Learning: A Case Study of Accelerating Machine Learning using Coding

In this paper we study the use of coding techniques to accelerate machin...
research
09/28/2021

Learning to Superoptimize Real-world Programs

Program optimization is the process of modifying software to execute mor...
research
10/23/2018

Automatic Full Compilation of Julia Programs and ML Models to Cloud TPUs

Google's Cloud TPUs are a promising new hardware architecture for machin...
research
05/31/2022

End-to-end Optimization of Machine Learning Prediction Queries

Prediction queries are widely used across industries to perform advanced...

Please sign up or login with your details

Forgot password? Click here to reset