[论文解读] MLComp: A Methodology for Machine Learning-based Performance Estimation and Adaptive Selection of Pareto-Optimal Compiler Optimization Sequences
MLComp 提出了一种基于强化学习的自适应、多目标编译器优化顺序方法,使用快速且高度准确的机器学习性能估计器替代耗时的动态分析。该方法在 x86 和 RISC-V 平台上实现了最高 12% 的执行时间改进和 6% 的能耗降低,相对误差低于 2%,且训练速度比现有最先进模型快 50 倍。
Embedded systems have proliferated in various consumer and industrial applications with the evolution of Cyber-Physical Systems and the Internet of Things. These systems are subjected to stringent constraints so that embedded software must be optimized for multiple objectives simultaneously, namely reduced energy consumption, execution time, and code size. Compilers offer optimization phases to improve these metrics. However, proper selection and ordering of them depends on multiple factors and typically requires expert knowledge. State-of-the-art optimizers facilitate different platforms and applications case by case, and they are limited by optimizing one metric at a time, as well as requiring a time-consuming adaptation for different targets through dynamic profiling. To address these problems, we propose the novel MLComp methodology, in which optimization phases are sequenced by a Reinforcement Learning-based policy. Training of the policy is supported by Machine Learning-based analytical models for quick performance estimation, thereby drastically reducing the time spent for dynamic profiling. In our framework, different Machine Learning models are automatically tested to choose the best-fitting one. The trained Performance Estimator model is leveraged to efficiently devise Reinforcement Learning-based multi-objective policies for creating quasi-optimal phase sequences. Compared to state-of-the-art estimation models, our Performance Estimator model achieves lower relative error (<2%) with up to 50x faster training time over multiple platforms and application domains. Our Phase Selection Policy improves execution time and energy consumption of a given code by up to 12% and 6%, respectively. The Performance Estimator and the Phase Selection Policy can be trained efficiently for any target platform and application domain.
研究动机与目标
- 解决固定、单目标编译器优化策略的局限性,这些策略需要专家调优和动态分析。
- 实现在不同平台和应用领域中快速、自动化的优化序列适应。
- 开发一种多目标优化框架,同时改善执行时间、能耗和代码大小。
- 通过使用快速、准确的基于机器学习的性能估计替代耗时的动态分析,减少对动态分析的依赖。
提出的方法
- 训练一个基于机器学习的性能估计器(PE)模型,利用静态编译器指标预测动态程序特征,如执行时间、能耗和代码大小。
- 通过启发式搜索,PE 模型自动选择最优的数据预处理方法和机器学习算法(例如 XGBoost、LightGBM),以最大化预测准确性。
- 使用 PE 模型训练基于强化学习(RL)的阶段选择策略(PSS),以推荐帕累托最优的编译器优化阶段序列。
- PSS 策略在模拟环境中使用 PE 模型的预测结果进行训练,实现无需重复动态分析的快速策略适应。
- 通过使用极少的动态分析数据重新训练 PE 和 PSS 模型,该框架支持自动化的、与平台无关的部署。
- 该方法实现了在不同编译器、平台和应用领域中端到端、自动化且可重用的优化适应。
实验结果
研究问题
- RQ1基于机器学习的性能估计器是否能在不同平台和应用中实现高精度,同时保持极低的动态分析开销?
- RQ2基于强化学习的策略在为多项目标选择帕累托最优编译器优化序列方面是否有效?
- RQ3与依赖大量动态分析的现有最先进方法相比,所提出的方法是否能显著减少适应时间?
- RQ4PE 模型在无需手动重新配置的情况下,对不同编译器目标和应用工作负载的泛化能力如何?
- RQ5与单目标的最先进方法相比,PSS 策略在执行时间、能耗和代码大小方面的多目标优化性能如何?
主要发现
- 性能估计器模型在执行时间、能耗、代码大小和指令数上的最大相对误差低于 2%,优于现有最先进模型(误差为 2–7%)。
- 与以往工作相比,PE 模型将训练时间减少了最多 50 倍,仅需 2 天的动态分析即可完成完整模型训练,而以往研究需 15–108 天。
- 阶段选择策略(PSS)相比标准编译器优化,可将执行时间最多提升 12%,并将能耗最多降低 6%。
- 在优化多项目标时,PSS 策略保持或略微改善代码大小(提升 0.1%),避免了单目标方法中常见的权衡问题。
- 该方法实现了在不同平台(x86 和 RISC-V)和应用领域(PARSEC 和 BEEBS 基准测试)中完全自动化、可重用且快速的优化策略适应。
- 该框架展现出卓越的泛化能力和效率,部署新目标时几乎无需人工干预。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。