[论文解读] Tiramisu: a polyhedral compiler for expressing fast and portable code
Tiramisu 是一种多面体编译器,通过将灵活的多面体表示与丰富的调度语言相结合,为多核 CPU、GPU 和分布式系统生成高性能且可移植的代码。它通过四层中间表示,将算法、循环转换、数据布局和通信解耦,从而在图像处理、狭义计算、线性代数和深度学习等不同架构上实现最先进的性能表现。
This paper introduces Tiramisu, a polyhedral framework designed to generate high performance code for multiple platforms including multicores, GPUs, and distributed machines. Tiramisu introduces a scheduling language with novel extensions to explicitly manage the complexities that arise when targeting these systems. The framework is designed for the areas of image processing, stencils, linear algebra and deep learning. Tiramisu has two main features: it relies on a flexible representation based on the polyhedral model and it has a rich scheduling language allowing fine-grained control of optimizations. Tiramisu uses a four-level intermediate representation that allows full separation between the algorithms, loop transformations, data layouts, and communication. This separation simplifies targeting multiple hardware architectures with the same algorithm. We evaluate Tiramisu by writing a set of image processing, deep learning, and linear algebra benchmarks and compare them with state-of-the-art compilers and hand-tuned libraries. We show that Tiramisu matches or outperforms existing compilers and libraries on different hardware architectures, including multicore CPUs, GPUs, and distributed machines.
研究动机与目标
- 解决在图像处理、狭义计算、线性代数和深度学习等性能关键领域中,为异构架构编写可移植、高性能代码的挑战。
- 在保持跨多种硬件平台可移植性的前提下,实现对循环优化和数据布局转换的细粒度控制。
- 通过四层中间表示,将算法规范与调度和数据布局等低层实现细节解耦。
- 通过自动但精确的优化,实现对多核 CPU、GPU 和分布式系统的性能超越现有编译器和手工调优库。
- 提供统一框架,简化对多种架构的适配,而无需重写核心算法。
提出的方法
- 该框架使用四层中间表示,将算法定义、循环转换、数据布局和通信模式分离开来。
- 采用一种新颖的调度语言,并通过扩展以表达针对多核、GPU 和分布式系统的复杂优化。
- 使用多面体模型作为灵活的基础,用于表示和转换嵌套循环及数据依赖关系。
- 该系统支持为多种后端(包括 CPU、GPU 和分布式集群)自动生成代码。
- 如分块、并行化、向量化和数据布局转换等优化,均通过调度语言表达。
- 通过将高层算法设计与低层硬件特定细节解耦,实现可移植的高性能。
实验结果
研究问题
- RQ1多面体编译器是否能在多种架构上实现与手工调优库或最先进编译器相当甚至更优的性能?
- RQ2通过统一的中间表示,单个算法在多核 CPU、GPU 和分布式系统上的高效目标化程度如何?
- RQ3所提出的调度语言在表达异构系统复杂优化方面的有效性如何?
- RQ4四层中间表示中的关注点分离是否能在不牺牲性能的前提下简化移植与优化?
- RQ5该框架是否能在图像处理、深度学习和线性代数等领域的可移植高性能代码生成中发挥作用?
主要发现
- 在图像处理、深度学习和线性代数工作负载中,Tiramisu 在多核 CPU、GPU 和分布式机器上均达到或超越了现有编译器和手工调优库的性能表现。
- 四层中间表示成功地将算法逻辑与调度和数据布局解耦,实现了在多种异构架构上的高效移植。
- 调度语言允许对优化进行细粒度控制,支持异构系统实现高性能所需的复杂转换。
- 该框架在无需手动低层调优的情况下实现高性能,证明了其自动化但表达力强的优化管道的有效性。
- Tiramisu 实现了在多个平台上的可移植高性能代码生成,显著减少了对架构特定的手动优化需求。
- 在真实世界基准上的评估表明,Tiramisu 在所有目标领域中均实现了与最先进工具相当或更优的性能。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。