Generating Fast Sparse Matrix Vector Multiplication From a High Level Generic Functional IR

Pizzuti, F., Steuwer, M. and Dubach, C. (2020) Generating Fast Sparse Matrix Vector Multiplication From a High Level Generic Functional IR. In: ACM SIGPLAN 2020 International Conference on Compiler Construction (CC 2020), San Diego, CA, USA, 22-23 Feb 2020, pp. 85-95. ISBN 9781450371209 (doi: 10.1145/3377555.3377896)

206621.pdf - Accepted Version



Usage of high-level intermediate representations promises the generation of fast code from a high-level description, improving the productivity of developers while achieving the performance traditionally only reached with low-level programming approaches. High-level IRs come in two flavors: 1) domain-specific IRs designed only for a specific application area; or 2) generic high-level IRs that can be used to generate high-performance code across many domains. Developing generic IRs is more challenging but offers the advantage of reusing a common compiler infrastructure across various applications. In this paper, we extend a generic high-level IR to enable efficient computation with sparse data structures. Crucially, we encode sparse representation using reusable dense building blocks already present in the high-level IR. We use a form of dependent types to model sparse matrices in CSR format by expressing the relationship between multiple dense arrays explicitly separately storing the length of rows, the column indices, and the non-zero values of the matrix. We achieve high-performance compared to sparse low-level library code using our extended generic high-level code generator. On an Nvidia GPU, we outperform the highly tuned Nvidia cuSparse implementation of spmv multiplication across 28 sparse matrices of varying sparsity on average by 1.7×.

Item Type:Conference Proceedings
Additional Information:This work was supported by the Engineering and Physical Sciences Research Council (grant EP/L01503X/1), EPSRC Centre for Doctoral Training in Pervasive Parallelism at the University of Edinburgh, School of Informatics.
Glasgow Author(s) Enlighten ID:Steuwer, Dr Michel
Authors: Pizzuti, F., Steuwer, M., and Dubach, C.
College/School:College of Science and Engineering > School of Computing Science
Copyright Holders:Copyright © 2020 The Authors
Publisher Policy:Reproduced in accordance with the copyright policy of the publisher

University Staff: Request a correction | Enlighten Editors: Update this record