arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.14908cs.PL
收藏

基于多阶段学习的编译器自动调优

Compiler Auto-tuning through Multiple Phase Learning

Mingxuan Zhu, Dan Hao, Junjie Chen

AI总结:

针对编译器优化标志自动调优中搜索空间大、运行时成本高的问题,提出结合轻量级性能预测模型与新型粒子群算法的CompTuner方法,实验证明其性能显著优于现有最优技术。

摘要:

GCC、LLVM等广泛使用的编译器通常拥有数百个由优化标志控制的优化选项,编译时通过启用或禁用这些标志来提升被编译程序的运行时性能(如缩短执行时间)。由于优化标志数量庞大且组合方式多样,编译器用户很难手动调整编译器优化标志。现有文献已提出多种自动调优技术,它们通过对比不同优化标志组合下程序的实际运行时性能,为待编译程序调整优化标志。但受限于巨大的搜索空间和高昂的实际运行时成本,这类技术普遍存在公认的效率问题。为降低高昂的运行时成本,本文提出一种轻量级学习方法,它利用少量实际运行时性能数据,预测采用不同优化标志组合的被编译程序的运行时性能。此外,为缩小搜索空间,我们设计了一种新型粒子群算法,结合该预测模型来调整编译器优化标志。为评估所提方法CompTuner的性能,我们针对两款流行C语言编译器GCC和LLVM,结合两个广泛使用的基准测试集cBench和PolyBench开展了大规模实验研究。实验结果表明,CompTuner的性能显著优于包括当前最优技术BOCA在内的五种对比技术。

英文摘要:

Widely used compilers like GCC and LLVM usually have hundreds of optimizations controlled by optimization flags, which are enabled or disabled during compilation to improve runtime performance (e.g., small execution time) of the compiler program. Due to the large number of optimization flags and their combination, it is difficult for compiler users to manually tune compiler optimization flags. In the literature, a number of auto-tuning techniques have been proposed, which tune optimization flags for a compiled program by comparing its actual runtime performance with different optimization flag combination. Due to the huge search space and heavy actual runtime cost, these techniques suffer from the widely-recognized efficiency problem. To reduce the heavy runtime cost, in this paper we propose a lightweight learning approach which uses a small number of actual runtime performance data to predict the runtime performance of a compiled program with various optimization flag combination. Furthermore, to reduce the search space, we design a novel particle swarm algorithm which tunes compiler optimization flags with the prediction model. To evaluate the performance of the proposed approach CompTuner, we conduct an extensive experimental study on two popular C compilers GCC and LLVM with two widely used benchmarks cBench and PolyBench. The experimental results show that CompTuner significantly outperforms the five compared techniques, including the state-of-art technique BOCA.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑