What is it about?
Optimizing programs to run efficiently on modern parallel hardware is hard but crucial for many applications. The most common languages force the programmer to intertwine the code describing functionality and optimizations. This results in a portability nightmare that is particularly problematic given the accelerating trend towards specialized hardware devices to increase efficiency. Many new DSLs used in performance demanding areas such as deep learning or high-performance image processing attempt to simplify or 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 show how to use functional programming techniques to solve this challenge with elegance. We present two functional languages that work together - each addressing a separate concern. RISE is a functional language for expressing computations using well known functional data-parallel patterns. ELEVATE is a functional language for describing optimization strategies. A high-level RISE program is trans- formed into a low-level form using optimization strategies written in ELEVATE. From the rewritten low-level program high-performance parallel code is automatically generated. In contrast to existing high-performance domain-specific systems with scheduling APIs, in our approach programmers are not restricted to a set of built-in operations and optimizations but freely define their own computational patterns in RISE and optimiza- tion strategies in ELEVATE in a composable and reusable way. We show how our holistic functional approach achieves competitive performance with the state-of-the-art imperative systems Halide and TVM.
Featured Image
Photo by Maxwell Nelson on Unsplash
Read the Original
This page is a summary of: Achieving high-performance the functional way: a functional pearl on expressing high-performance optimizations as rewrite strategies, Proceedings of the ACM on Programming Languages, August 2020, ACM (Association for Computing Machinery),
DOI: 10.1145/3408974.
You can read the full text:
Contributors
The following have contributed to this page







