Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3592 > unrolled thread

Machine learning to schedule optimization passes

Started byJohn R Levine <johnl@taugh.com>
First post2024-08-29 12:21 -0400
Last post2024-08-29 20:45 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.compilers


Contents

  Machine learning to schedule optimization passes John R Levine <johnl@taugh.com> - 2024-08-29 12:21 -0400
    Re: Machine learning to schedule optimization passes Jon Chesterfield <jonathanchesterfield@gmail.com> - 2024-08-29 20:45 +0100

#3592 — Machine learning to schedule optimization passes

FromJohn R Levine <johnl@taugh.com>
Date2024-08-29 12:21 -0400
SubjectMachine learning to schedule optimization passes
Message-ID<24-08-011@comp.compilers>
This paper used machine learning to select and order LLVM optimization
passes.  Apparently it worked pretty well.


CompilerDream: Learning a Compiler World Model for General Code Optimization

Effective code optimization in compilers is crucial for computer and
software engineering. The success of these optimizations primarily depends
on the selection and ordering of the optimization passes applied to the
code. While most compilers rely on a fixed sequence of optimization
passes, current methods to find the optimal sequence either employ
impractically slow search algorithms or learning methods that struggle to
generalize to code unseen during training. We introduce CompilerDream, a
model-based reinforcement learning approach to general code optimization.
CompilerDream comprises a compiler world model that accurately simulates
the intrinsic properties of optimization passes and an agent trained on
this model to produce effective optimization strategies. By training on a
large-scale program dataset, CompilerDream is equipped to serve as a
general code optimizer across various application scenarios and
source-code languages. Our extensive experiments first highlight
CompilerDream's strong optimization capabilities for autotuning, where it
leads the CompilerGym leaderboard. More importantly, the zero-shot
generalization ability of large-scale trained compiler world model and
agent, excels across diverse datasets, surpassing LLVM's built-in
optimizations and other state-of-the-art methods in both settings of value
prediction and end-to-end code optimization.

Full paper at: https://arxiv.org/abs/2404.16077

Regards,
John Levine, johnl@taugh.com, Taughannock Networks, Trumansburg NY
Please consider the environment before reading this e-mail. https://jl.ly

[toc] | [next] | [standalone]


#3593

FromJon Chesterfield <jonathanchesterfield@gmail.com>
Date2024-08-29 20:45 +0100
Message-ID<24-08-013@comp.compilers>
In reply to#3592
This paper makes no mention of correctness or behaviour, only code size. Also
no mention of compile time. I wonder how the results would compare to a
baseline of running the usual O3 pipeline to fixpoint.



Changing order of passes usually uncovers correctness bugs which papers of
this genre rarely worry about. It's very easy to make programs smaller if you
don't mind changing behaviour.



Jon


On Thu, 29 Aug 2024, 19:35 John R Levine,
<[johnl@taugh.com](mailto:johnl@taugh.com)> wrote:

> This paper used machine learning to select and order LLVM optimization
>  passes. Apparently it worked pretty well.
>
>
>  CompilerDream: Learning a Compiler World Model for General Code Optimization
>
>  Effective code optimization in compilers is crucial for computer and
>  software engineering. ...
>
>  Full paper at: <https://arxiv.org/abs/2404.16077>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.compilers


csiph-web