Learning to Superoptimize Real-world Programs
- URL: http://arxiv.org/abs/2109.13498v1
- Date: Tue, 28 Sep 2021 05:33:21 GMT
- Title: Learning to Superoptimize Real-world Programs
- Authors: Alex Shypula, Pengcheng Yin, Jeremy Lacomis, Claire Le Goues, Edward
Schwartz, Graham Neubig
- Abstract summary: We propose a framework to learn to superoptimize real-world programs by using neural sequence-to-sequence models.
We introduce the Big Assembly benchmark, a dataset consisting of over 25K real-world functions mined from open-source projects in x86-64 assembly.
- Score: 79.4140991035247
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Program optimization is the process of modifying software to execute more
efficiently. Because finding the optimal program is generally undecidable,
modern compilers usually resort to expert-written heuristic optimizations. In
contrast, superoptimizers attempt to find the optimal program by employing
significantly more expensive search and constraint solving techniques.
Generally, these methods do not scale well to programs in real development
scenarios, and as a result superoptimization has largely been confined to
small-scale, domain-specific, and/or synthetic program benchmarks. In this
paper, we propose a framework to learn to superoptimize real-world programs by
using neural sequence-to-sequence models. We introduce the Big Assembly
benchmark, a dataset consisting of over 25K real-world functions mined from
open-source projects in x86-64 assembly, which enables experimentation on
large-scale optimization of real-world programs. We propose an approach, Self
Imitation Learning for Optimization (SILO) that is easy to implement and
outperforms a standard policy gradient learning approach on our Big Assembly
benchmark. Our method, SILO, superoptimizes programs an expected 6.2% of our
test set when compared with the gcc version 10.3 compiler's aggressive
optimization level -O3. We also report that SILO's rate of superoptimization on
our test set is over five times that of a standard policy gradient approach and
a model pre-trained on compiler optimization demonstration.
Related papers
- Should AI Optimize Your Code? A Comparative Study of Current Large Language Models Versus Classical Optimizing Compilers [0.0]
Large Language Models (LLMs) raise intriguing questions about the potential for AI-driven approaches to revolutionize code optimization methodologies.
This paper presents a comparative analysis between two state-of-the-art Large Language Models, GPT-4.0 and CodeLlama-70B, and traditional optimizing compilers.
arXiv Detail & Related papers (2024-06-17T23:26:41Z) - Iterative or Innovative? A Problem-Oriented Perspective for Code Optimization [81.88668100203913]
Large language models (LLMs) have demonstrated strong capabilities in solving a wide range of programming tasks.
In this paper, we explore code optimization with a focus on performance enhancement, specifically aiming to optimize code for minimal execution time.
arXiv Detail & Related papers (2024-06-17T16:10:10Z) - CompilerDream: Learning a Compiler World Model for General Code Optimization [58.87557583347996]
We introduce CompilerDream, a model-based reinforcement learning approach to general code optimization.
It 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.
It 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.
arXiv Detail & Related papers (2024-04-24T09:20:33Z) - Localized Zeroth-Order Prompt Optimization [54.964765668688806]
We propose a novel algorithm, namely localized zeroth-order prompt optimization (ZOPO)
ZOPO incorporates a Neural Tangent Kernel-based derived Gaussian process into standard zeroth-order optimization for an efficient search of well-performing local optima in prompt optimization.
Remarkably, ZOPO outperforms existing baselines in terms of both the optimization performance and the query efficiency.
arXiv Detail & Related papers (2024-03-05T14:18:15Z) - Large Language Models for Compiler Optimization [22.52765975286403]
We present a transformer model trained from scratch to optimize LLVM assembly for code size.
We ask the model to predict the instruction counts before and after optimization, and the optimized code itself.
Our approach achieves a 3.0% improvement in reducing instruction counts over the compiler.
arXiv Detail & Related papers (2023-09-11T22:11:46Z) - Large Language Models as Optimizers [106.52386531624532]
We propose Optimization by PROmpting (OPRO), a simple and effective approach to leverage large language models (LLMs) as prompts.
In each optimization step, the LLM generates new solutions from the prompt that contains previously generated solutions with their values.
We demonstrate that the best prompts optimized by OPRO outperform human-designed prompts by up to 8% on GSM8K, and by up to 50% on Big-Bench Hard tasks.
arXiv Detail & Related papers (2023-09-07T00:07:15Z) - Learning Performance-Improving Code Edits [107.21538852090208]
We introduce a framework for adapting large language models (LLMs) to high-level program optimization.
First, we curate a dataset of performance-improving edits made by human programmers of over 77,000 competitive C++ programming submission pairs.
For prompting, we propose retrieval-based few-shot prompting and chain-of-thought, and for finetuning, these include performance-conditioned generation and synthetic data augmentation based on self-play.
arXiv Detail & Related papers (2023-02-15T18:59:21Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.