Achieving high-performance the functional way: a functional pearl on expressing high-performance optimizations as rewrite strategies

Author:

Hagedorn Bastian1ORCID,Lenfers Johannes1,Kœhler Thomas2,Qin Xueying2,Gorlatch Sergei1,Steuwer Michel2ORCID

Affiliation:

1. University of Münster, Germany

2. University of Glasgow, UK

Abstract

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 portability nightmare that 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 or high-performance 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 functional pearl, we show how to employ 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 transformed 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 optimization 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.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference50 articles.

1. PORGY: Strategy-Driven Interactive Transformation of Graphs

2. Robert Atkey Michel Steuwer Sam Lindley and Christophe Dubach. 2017. Strategy Preserving Compilation for Parallel Functional Code. CoRR abs/1710.08332 ( 2017 ). Robert Atkey Michel Steuwer Sam Lindley and Christophe Dubach. 2017. Strategy Preserving Compilation for Parallel Functional Code. CoRR abs/1710.08332 ( 2017 ).

3. Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code

4. Machine Learning Systems are Stuck in a Rut

Cited by 10 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect Dependencies;Proceedings of the ACM on Programming Languages;2023-10-16

2. Using Rewrite Strategies for Efficient Functional Automatic Differentiation;Proceedings of the 25th ACM International Workshop on Formal Techniques for Java-like Programs;2023-07-18

3. Achieving High Performance the Functional Way;Communications of the ACM;2023-02-22

4. (De/Re)-Compositions Expressed Systematically via MDH-Based Schedules;Proceedings of the 32nd ACM SIGPLAN International Conference on Compiler Construction;2023-02-17

5. Structured Operations: Modular Design of Code Generators for Tensor Compilers;Languages and Compilers for Parallel Computing;2023

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3