Compiler-R1: Towards Agentic Compiler Auto-tuning with Reinforcement Learning

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Pan, Haolin, Lin, Hongyu, Luo, Haoran, Liu, Yang, Yao, Kaichun, Zhang, Libo, Xing, Mingjie, Wu, Yanjun
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915350515286016
author Pan, Haolin
Lin, Hongyu
Luo, Haoran
Liu, Yang
Yao, Kaichun
Zhang, Libo
Xing, Mingjie
Wu, Yanjun
author_facet Pan, Haolin
Lin, Hongyu
Luo, Haoran
Liu, Yang
Yao, Kaichun
Zhang, Libo
Xing, Mingjie
Wu, Yanjun
contents Compiler auto-tuning optimizes pass sequences to improve performance metrics such as Intermediate Representation (IR) instruction count. Although recent advances leveraging Large Language Models (LLMs) have shown promise in automating compiler tuning, two significant challenges still remain: the absence of high-quality reasoning datasets for agents training, and limited effective interactions with the compilation environment. In this work, we introduce Compiler-R1, the first reinforcement learning (RL)-driven framework specifically augmenting LLM capabilities for compiler auto-tuning. Compiler-R1 features a curated, high-quality reasoning dataset and a novel two-stage end-to-end RL training pipeline, enabling efficient environment exploration and learning through an outcome-based reward. Extensive experiments across seven datasets demonstrate Compiler-R1 achieving an average 8.46% IR instruction count reduction compared to opt -Oz, showcasing the strong potential of RL-trained LLMs for compiler optimization. Our code and datasets are publicly available at https://github.com/Panhaolin2001/Compiler-R1.
format Preprint
id arxiv_https___arxiv_org_abs_2506_15701
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Compiler-R1: Towards Agentic Compiler Auto-tuning with Reinforcement Learning
Pan, Haolin
Lin, Hongyu
Luo, Haoran
Liu, Yang
Yao, Kaichun
Zhang, Libo
Xing, Mingjie
Wu, Yanjun
Machine Learning
Artificial Intelligence
Compiler auto-tuning optimizes pass sequences to improve performance metrics such as Intermediate Representation (IR) instruction count. Although recent advances leveraging Large Language Models (LLMs) have shown promise in automating compiler tuning, two significant challenges still remain: the absence of high-quality reasoning datasets for agents training, and limited effective interactions with the compilation environment. In this work, we introduce Compiler-R1, the first reinforcement learning (RL)-driven framework specifically augmenting LLM capabilities for compiler auto-tuning. Compiler-R1 features a curated, high-quality reasoning dataset and a novel two-stage end-to-end RL training pipeline, enabling efficient environment exploration and learning through an outcome-based reward. Extensive experiments across seven datasets demonstrate Compiler-R1 achieving an average 8.46% IR instruction count reduction compared to opt -Oz, showcasing the strong potential of RL-trained LLMs for compiler optimization. Our code and datasets are publicly available at https://github.com/Panhaolin2001/Compiler-R1.
title Compiler-R1: Towards Agentic Compiler Auto-tuning with Reinforcement Learning
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2506.15701