arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.04238cs.PLcs.LG
收藏

POSET-RL:使用强化学习优化规模和执行时间的阶段排序

POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learning

IIT Hyderabad(印度理工学院海得拉巴分校)

Shalini Jain, Yashas Andaluri, S. VenkataKeerthy, Ramakrishna Upadrasta

摘要:

几个应用程序的不断增加的内存需求导致了嵌入式设备可能无法满足的需求增加。在这种情况下,限制内存的使用至关重要。重要的是,这种代码大小的改进不应该对运行时产生负面影响。在优化代码大小的同时改善执行时间是一项重要的任务。现代编译器中标准优化序列的顺序是固定的,并且由编译器领域专家基于他们的专业知识来创建。然而,这种排序是次优的,并且不能很好地推广到所有情况。我们提出了一个基于强化学习的解决方案的阶段排序问题,其中排序提高了执行时间和代码大小。我们提出了两种不同的方法来建模的序列:一个手动排序,和其他基于一个图称为奥兹依赖图(ODG)。我们的方法使用最少的数据作为训练集,并与LLVM集成。我们在SPEC-CPU 2006、SPEC-CPU 2017和MiBench的基准测试中展示了x86和AArch 64架构的结果。我们观察到,在SPEC 2017基准测试中,基于ODG的拟议模型在大小和执行时间方面均优于当前的Oz序列,平均分别为6.19%和11.99%。

英文摘要:

The ever increasing memory requirements of several applications has led to increased demands which might not be met by embedded devices. Constraining the usage of memory in such cases is of paramount importance. It is important that such code size improvements should not have a negative impact on the runtime. Improving the execution time while optimizing for code size is a non-trivial but a significant task. The ordering of standard optimization sequences in modern compilers is fixed, and are heuristically created by the compiler domain experts based on their expertise. However, this ordering is sub-optimal, and does not generalize well across all the cases. We present a reinforcement learning based solution to the phase ordering problem, where the ordering improves both the execution time and code size. We propose two different approaches to model the sequences: one by manual ordering, and other based on a graph called Oz Dependence Graph (ODG). Our approach uses minimal data as training set, and is integrated with LLVM. We show results on x86 and AArch64 architectures on the benchmarks from SPEC-CPU 2006, SPEC-CPU 2017 and MiBench. We observe that the proposed model based on ODG outperforms the current Oz sequence both in terms of size and execution time by 6.19% and 11.99% in SPEC 2017 benchmarks, on an average.

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

↑