论文标题

描述优化策略的语言

A Language for Describing Optimization Strategies

论文作者

Hagedorn, Bastian, Lenfers, Johannes, Koehler, Thomas, Gorlatch, Sergei, Steuwer, Michel

论文摘要

优化在现代并行硬件上有效运行的程序很难,但对于许多应用程序至关重要。主要使用命令式语言(例如C或OpenCL)迫使程序员将描述功能和优化的代码交织在一起。这导致了一场噩梦,这尤其是有问题的,鉴于朝着专门的硬件设备迈出的加速趋势以进一步提高效率。 许多用于性能要求域中的新兴DSL,例如深度学习,自动差异化或图像处理,试图简化甚至完全自动化优化过程。使用高级(通常是功能性的语言),程序员专注于以声明性的方式描述功能。在卤化物或TVM等某些系统中,单独的时间表指定了如何优化程序。不幸的是,这些时间表不是用定义明确的编程语言编写的。取而代之的是,它们是作为编译器作者所揭露的一组临时预定义API的实施。 在本文中,我们提出了提升:一种用于描述优化策略的功能语言。提升遵循在不同环境中使用的先前系统的传统,这些系统以不同的方式表达优化策略作为重写的组成。与安排API的系统相反,在提升的程序中,程序员不仅限于一组内置的优化,而是以合理的方式自由定义自己的优化策略。我们展示了如何提升用户定义的优化策略,以实现用功能数据并行语言表达的程序的有效优化,以证明与卤化物和TVM的竞争性能。

Optimizing programs to run efficiently on modern parallel hardware is hard but crucial for many applications. The predominantly used imperative languages - like C or OpenCL - force the programmer to intertwine the code describing functionality and optimizations. This results in a nightmare for portability which is particularly problematic given the accelerating trend towards specialized hardware devices to further increase efficiency. Many emerging DSLs used in performance demanding domains such as deep learning, automatic differentiation, or image processing attempt to simplify or even fully automate the optimization process. Using a high-level - often functional - language, programmers focus on describing functionality in a declarative way. In some systems such as Halide or TVM, a separate schedule specifies how the program should be optimized. Unfortunately, these schedules are not written in well-defined programming languages. Instead, they are implemented as a set of ad-hoc predefined APIs that the compiler writers have exposed. In this paper, we present Elevate: a functional language for describing optimization strategies. Elevate follows a tradition of prior systems used in different contexts that express optimization strategies as composition of rewrites. In contrast to systems with scheduling APIs, in Elevate programmers are not restricted to a set of built-in optimizations but define their own optimization strategies freely in a composable way. We show how user-defined optimization strategies in Elevate enable the effective optimization of programs expressed in a functional data-parallel language demonstrating competitive performance with Halide and TVM.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源