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

一种描述最优化策略的语言

A Language for Describing Optimization Strategies

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

摘要:

优化程序以在现代并行硬件上高效运行是困难的,但对许多应用程序至关重要。主要使用的命令式语言(如C或OpenCL)迫使程序员插入描述功能和优化的代码。这导致便携性的噩梦,考虑到专用硬件设备进一步提高效率的加速趋势,这是特别成问题的。在性能要求高的领域(例如深度学习、自动微分或图像处理)中使用的许多新兴DSL试图简化或甚至完全自动化优化过程。使用高级语言(通常是函数式语言),程序员专注于以声明的方式描述功能。在一些系统中,如Halide或TVM,一个单独的时间表指定了程序应该如何优化。不幸的是,这些调度不是用定义良好的程序设计语言编写的。相反,它们被实现为编译器编写者公开的一组特定的预定义API。在本文中,我们提出了Elevate:一种用于描述优化策略的函数语言。Elevate遵循在不同上下文中使用的现有系统的传统,将优化策略表达为重写的组合。与具有调度API的系统相比,在Elevate中,程序员不限于一组内置的优化,而是以可组合的方式自由定义自己的优化策略。我们展示了如何在Elevate中使用用户定义的优化策略来有效地优化以函数数据并行语言表示的程序,从而展示出与Halide和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.

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

↑