paper-with-me

Papers

CompilerDream: Learning a Compiler World Model for General Code Optimization

2024-04-24 · Chaoyi Deng, Jialong Wu, Ningya Feng, Jianmin Wang, Mingsheng Long

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.

📄 PDF Abstract BibTeX arXiv:2404.16077

Code (1)

thuml/CompilerDream 공식 구현 pytorch

Tasks

DiversityModel-based Reinforcement Learningreinforcement-learningValue predictionZero-shot Generalization

Similar Papers 제목 키워드 기반

Understanding Agent-Based Patching of Compiler Missed Optimizations

2026-07-02 · Batu Guan, Zirui Wang, Shaohua Li arxiv

Compiler missed optimizations refer to cases in which compilers failed to optimize certain code. It takes many compiler developers' efforts to implement or patch such missed optimizations. In this paper, we present a sys…

Finding Missed Code Size Optimizations in Compilers using LLMs

2024-12-31 · Davide Italiano, Chris Cummins

Compilers are complex, and significant effort has been expended on testing them. Techniques such as random program generation and differential testing have proved highly effective and have uncovered thousands of bugs in …

MLGO: a Machine Learning Guided Compiler Optimizations Framework

2021-01-13 · Mircea Trofin, Yundi Qian, Eugene Brevdo, Zinan Lin 외

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 p…

BIG-bench Machine LearningDiversity

CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research

2021-09-17 · Chris Cummins, Bram Wasti, Jiadong Guo, Brandon Cui 외

Interest in applying Artificial Intelligence (AI) techniques to compiler optimizations is increasing rapidly, but compiler research has a high entry barrier. Unlike in other domains, compiler and AI researchers do not ha…

Compiler OptimizationOpenAI Gym

WhiteFox: White-Box Compiler Fuzzing Empowered by Large Language Models

2023-10-24 · Chenyuan Yang, Yinlin Deng, Runyu Lu, Jiayi Yao 외

Compiler correctness is crucial, as miscompilation can falsify program behaviors, leading to serious consequences. Fuzzing has been studied to uncover compiler defects. However, compiler fuzzing remains challenging: Exis…

Code GenerationCompiler Optimization