paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Efficient Compiler Autotuning via Bayesian Optimization

基于贝叶斯优化的高效编译器自动调优
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 论文将贝叶斯优化应用于编译器优化 flag 自动调优,属于 PL/编译器与 ML 的交叉,但并非用户核心关注的静态分析、浮点程序分析、LLM/Agent 或贝叶斯程序分析;仅在“贝叶斯方法”上有表面关联。引用 101 inbox
Junjie Chen, Ningxin Xu, Peiqi Chen, Hongyu Zhang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 BOCA,首个基于贝叶斯优化的编译器自动调优方法,高效搜索优化 flag 组合。

GCC 等编译器支持数百个由编译 flag 控制的优化,其组合数量随 flag 数量指数增长,用户难以手工调优以获得所需运行时性能。已有编译器自动调优方法虽能自动搜索优化 flag,但面临巨大搜索空间导致的效率问题。本文提出首个基于贝叶斯优化的编译器自动调优方法 BOCA:使用树模型近似目标函数,使贝叶斯优化可扩展到大量优化 flag;并设计新的搜索策略,结合树模型度量的每个优化 flag 影响与衰减函数,在利用与探索之间取得平衡。作者在 GCC、LLVM 两个 C 编译器以及 cBench、PolyBench 两个基准上开展大量实验。结果表明,在达到指定加速比所需时间上,BOCA 显著优于当前最先进的编译器自动调优方法和贝叶斯优化方法,验证了其有效性。

问题
编译器优化 flag 数量多且组合空间指数级增长,人工调优不可行,而现有自动调优方法因搜索空间巨大仍效率低下。
方法
提出 BOCA,用树模型近似目标函数以将贝叶斯优化扩展至大量优化 flag,并设计结合 flag 影响度量与衰减函数的搜索策略来平衡探索与利用。
评估
在 GCC、LLVM 和 cBench、PolyBench 上进行大量实验,比较达到指定加速比所需时间;BOCA 显著优于最先进的编译器自动调优方法和贝叶斯优化方法。
原文摘要(Abstract)

A typical compiler such as GCC supports hundreds of optimizations controlled by compilation flags for improving the runtime performance of the compiled program. Due to the large number of compilation flags and the exponential number of flag combinations, it is impossible for compiler users to manually tune these optimization flags in order to achieve the required runtime performance of the compiled programs. Over the years, many compiler autotuning approaches have been proposed to automatically tune optimization flags, but they still suffer from the efficiency problem due to the huge search space. In this paper, we propose the first Bayesian optimization based approach, called BOCA, for efficient compiler autotuning. In BOCA, we leverage a tree-based model for approximating the objective function in order to make Bayesian optimization scalable to a large number of optimization flags. Moreover, we design a novel searching strategy to improve the efficiency of Bayesian optimization by incorporating the impact of each optimization flag measured by the tree-based model and a decay function to strike a balance between exploitation and exploration. We conduct extensive experiments to investigate the effectiveness of BOCA on two most popular C compilers (i.e., GCC and LLVM) and two widely-used C benchmarks (i.e., cBench and PolyBench). The results show that BOCA significantly outperforms the state-of-the-art compiler autotuning approaches and Bayesion optimization methods in terms of the time spent on achieving specified speedups, demonstrating the effectiveness of BOCA.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{0003XC021,
  title = {Efficient Compiler Autotuning via Bayesian Optimization},
  author = {Junjie Chen and Ningxin Xu and Peiqi Chen and Hongyu Zhang},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00110}
}