Verified tensor-program optimization via high-level scheduling rewrites
Amanda Liu, Gilbert Bernstein, Adam J. Chlipala et al. · Proceedings of the ACM on Programming Languages · 2022
We present a lightweight Coq framework for optimizing tensor kernels written in a pure, functional array language. Optimizations rely on user scheduling using series of verified, semantics-preserving rewrites. Unusually for compilation targeting imperative code with arrays and nested loops, all rewrites are source-to-source within a purely functional language. Our language comprises a set of core constructs for expressing high-level computation detail and a set of what we call reshape operators, which can be derived from core constructs but trigger low-level decisions about storage patterns and ordering. We demonstrate that not only is this system capable of deriving the optimizations of existing state-of-the-art languages like Halide and generating comparably performant code, it is also able to schedule a family of useful program transformations beyond what is reachable in Halide.
Cited by 25 works. doi:10.1145/3498717 Open-access PDF
Authors
References
- Halide
- Parallel Programmability and the Chapel Language
- Memory---Sequoia
- Decoupling algorithms from schedules for easy optimization of image processing pipelines
- Legion: Expressing locality and independence with logical regions
- Accelerating Haskell array codes with multicore GPUs
- The tensor algebra compiler
- Taichi
- POET: Parameterized Optimizations for Empirical Tuning
- Annotation-based empirical performance tuning using Orio