Programming Matrices as Staged Sparse Rows to Generate Efficient Matrix-free Differential Equation Solver

04/28/2022
by   Huanqi Cao, et al.
0

Solving differential equations is a critical task in scientific computing. Domain-specific languages (DSLs) have been a promising direction in achieving performance and productivity, but the current state of the art only supports stencil computation, leaving solvers requiring loop-carried dependencies aside. Alternatively, sparse matrices can represent such equation solvers and are more general than existing DSLs, but the performance is sacrificed. This paper points out that sparse matrices can be represented as programs instead of data, having both the generality from the matrix-based representation and the performance from program optimizations. Based on the idea, we propose the Staged Sparse Row (SSR) sparse matrix representation that can efficiently cover applications on structured grids. With SSR representation, users can intuitively define SSR matrices using generator functions and use SSR matrices through a concise object-oriented interface. SSR matrices can then be chained and applied to construct the algorithm, including those with loop-carried dependences. We then apply a set of dedicated optimizations, and ultimately simplify the SSR matrix-based codes into straightforward matrix-free ones, which are efficient and friendly for further analysis. Implementing BT pseudo application in the NAS Parallel Benchmark, with less than 10% lines of code compared with the matrix-free reference FORTRAN implementation, we achieved up to 92.8% performance. Implementing a matrix-free variant for the High-Performance Conjugate Gradient benchmark, we achieve 3.29× performance compared with the reference implementation, while our implementation shares the same algorithm on the same programming abstraction, which is sparse matrices.

READ FULL TEXT
research
10/13/2017

On Parallel Solution of Sparse Triangular Linear Systems in CUDA

The acceleration of sparse matrix computations on modern many-core proce...
research
05/17/2018

Systematic encoders for generalized Gabidulin codes and the q-analogue of Cauchy matrices

We characterize the generator matrix in standard form of generalized Gab...
research
10/12/2018

Expressing Sparse Matrix Computations for Productive Performance on Spatial Architectures

This paper addresses spatial programming of sparse matrix computations f...
research
07/26/2020

Optimizing Block-Sparse Matrix Multiplications on CUDA with TVM

We implemented and optimized matrix multiplications between dense and bl...
research
05/09/2018

A User-Friendly Hybrid Sparse Matrix Class in C++

When implementing functionality which requires sparse matrices, there ar...
research
09/10/2019

Efficient Interleaved Batch Matrix Solvers for CUDA

In this paper we present a new methodology for data accesses when solvin...
research
08/01/2021

Iterative optimal solutions of linear matrix equations for Hyperspectral and Multispectral image fusing

For a linear matrix function f in X ∈^m× n we consider inhomogeneous lin...

Please sign up or login with your details

Forgot password? Click here to reset