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

ACC Saturator:面向基于指令的 GPU 代码的自动内核优化

ACC Saturator: Automatic Kernel Optimization for Directive-Based GPU Code

Kazuaki Matsumura, Simon Garcia De Gonzalo, Antonio J. Peña

AI总结:

本文提出 ACC Saturator,利用 equality saturation 自动优化基于指令的 GPU 顺序内核代码,在保持依赖的前提下重写并提取最优方案,显著提升多个编译器性能。

摘要:

自动代码优化是一个复杂过程,通常涉及应用多个离散算法,而这些算法会不可逆地修改程序结构。然而,这些算法的设计往往是单体式的,并且由于缺乏协作,它们需要重复实现以执行相似的分析。为解决这一问题,诸如 equality saturation(等价饱和)之类的现代优化技术允许在输入的不同层级进行穷举式项重写,从而简化编译器设计。本文提出使用 equality saturation 来优化 GPU 基于指令的编程中所使用的顺序代码。该方法同时实现更少的计算、更少的内存访问以及较高的内存吞吐量。我们的全自动框架从输入构造单赋值形式,以便在保持依赖关系的同时对其进行完整重写,并提取最优情形。通过实际基准测试,我们证明其在多个编译器上取得了显著的性能提升。此外,我们强调了计算重排的优势,并指出现代 GPU 中内存访问顺序的重要性。

英文摘要:

Automatic code optimization is a complex process that typically involves the application of multiple discrete algorithms that modify the program structure irreversibly. However, the design of these algorithms is often monolithic, and they require repetitive implementation to perform similar analyses due to the lack of cooperation. To address this issue, modern optimization techniques, such as equality saturation, allow for exhaustive term rewriting at various levels of inputs, thereby simplifying compiler design. In this paper, we propose equality saturation to optimize sequential codes utilized in directive-based programming for GPUs. Our approach realizes less computation, less memory access, and high memory throughput simultaneously. Our fully-automated framework constructs single-assignment forms from inputs to be entirely rewritten while keeping dependencies and extracts optimal cases. Through practical benchmarks, we demonstrate a significant performance improvement on several compilers. Furthermore, we highlight the advantages of computational reordering and emphasize the significance of memory-access order for modern GPUs.

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

↑