Vectorizing Recurrences over Semirings
Yihong Zhang, Bala Vinaithirthan, Karima Ma, Zachary Tatlock, Maaz Bin Safeer Ahmad, Andrew Adams
Abstract
Recurrences are ubiquitous in signal and image processing, bioinformatics, numerical computing, combinatorial optimization, and many other domains. Because recurrences seem inherently sequential, they are often implemented serially and thus do not leverage vector instructions in modern hardware. This leaves much of the available, often highly parallel, hardware underutilized. In this paper, we present an algebra of recurrences over semirings and study algebraic identities that enable vectorization. Using our algebraic framework, we present a number of vectorizing transformations that yield efficient, vectorized implementations across various settings. These transformations naturally extend to 2D recurrences and mutual recurrences. We implement the recurrence algebra and the vectorizing transformations in a compiler called VecRec.VecRec compiles recurrence programs to efficient vectorized C++ implementations. The generated kernels can achieve up to an order-of-magnitude speedup over serial implementations across a wide variety of recurrences. A case study in bioinformatics shows that they are competitive with, and in many cases better than, existing libraries with manually-crafted vectorization.
Create a lesson
Related papers
Handling JAX
Oghenevwogaga Ebresafe, Daniel Zheng, Gordon Plotkin et al.
Silent Degradation during Auto-Vectorization of bf16/fp16 on RISC-V Under LLVM
Vaishnavi Kouru, Robert Chun
Functional Logic Programming: Improving Logic Programs with Ease
Michael Hanus
MBUndo: Sound, Automatic, and Efficient Measurement-Based Uncomputation for Quantum Circuits
Shengyuan Yang, Charles Yuan
te-comp: A Complete MLIR Compiler Generating Self-Contained C Inference Engines for MCUs
Van Chan Ngo
Stochastic Summaries: Characterizing Structured Datasets Using Probabilistic Programs
Jack Stanek, Adithya Murali