Skip to content

Matrix computations with HODLR representation and mixed-precision simulations

License

Notifications You must be signed in to change notification settings

chenxinye/mhodlr

drawing

mhodlr: Matrix computations in HODLR representation

License MATLAB View mhodlr on File Exchange Documentation Status Open in MATLAB Online Hits

Abstract

Differential equations often result in rank-structured matrices associated with low-rank off-diagonal blocks. These matrices are often represented in a hierarchical format, and their operation often results in fast arithmetic, e.g., matrix-vector product. The hierarchical matrix [2] is a class of dense rank-structured matrices with a hierarchical low-rank off diagonal block structure, which frequently arises from finite element discretization of an elliptic PDE, radial basis function interpolation, and boundary integral equations. Hierarchical Off-Diagonal Low-Rank (HODLR) matrix, as a typical hierarchical matrix, is formulated by hierarchically partitioning the matrix in terms of a binary cluster tree and all off-diagonal blocks of each level of the tree are represented as low-rank matrices.

It is widely known that low precision can reduce data communication and be more energy- and storage-efficient. Regarding the IEEE standard for floating point, single precision arithmetic can be twice as fast as double precision on specific hardware and the half-precision arithmetic achieves 4 times speedup over double precision. Using the software mhodlr, one can know what precisions are required for the HODLR matrix construction by evaluating their reconstruction error and computations error by simulating various precisions. This repository is concerned with HODLR matrix construction as well as basic matrix computations with HOLDR matrices, which aims to provide a convenient API for HODLR operations and efficient simulations for mixed-precision and adaptive precision HODLR matrix computing [1]. Our low precision arithmetic is simulated in terms of [4].

Our software mainly contains three modules

Class Description
@hodlr Compute HODLR matrix
@mphodlr Compute HODLR matrix in mixed precision (precisions are defined by the users)
@amphodlr Compute HODLR matrix in adaptive precision (precisions are provided by the users)

Setup

The environment for running mhodlr is MATLAB2023a, MATLAB2023b, MATLAB2024a, MATLAB2024b.

One can fork this repository, and simply download this repository via

git clone https://github.com/<username>/mhodlr.git

Then add the destination folder where mhodlr is installed to MATLAB’s search path:

addpath('mhodlr/mhodlr')

Simple example on usage is referred to EXAMPLE.

Basic support routines

Note these routines work for @hodlr, @mphodlr, and @amphodlr modules,

Matrix computations API
Matrix transpose H.transpose()
Matrix inverse inverse(H)
Matrix (vector) multiplication hdot(A/H, H/B), mphdot(A/H, H/B)
LU factorization hlu(H/A), mhlu(H/A, prec)
Cholesky factorization hchol(H/A), mhchol(H/A, prec)
QR factorization hqr(H)
Triangular solver (Lower triangular solver LX=B, Upper triangular solver XU=B) htrsl(H, B), htrsu(B, H)
Linear solver (Ax = b) lu_solve(H, B)

Contributions

Any forms of contributions are welcomed. Our documents are still in progress; feel free to pull request and submit issues for suggestions. Before contributing code, we suggest to contact the maintainers. The contact information of maintainers can be found in MaintainerList.

Acknowledgement

This project is supported by the European Union (ERC, InEXASCALE, 101075632). Views and opinions expressed are those of the authors only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them.

DOI

References

[1] C. Erin, X. Chen and X. Liu, Mixed precision HODLR matrices, arXiv:2407.21637, (2024), https://doi.org/10.48550/arXiv.2407.21637.

[2] S. B¨orm, L. Grasedyck, and W. Hackbusch, Introduction to hierarchical matrices with applications, Eng. Anal. Bound. Elem., 27 (2003), pp. 405–422, https://doi.org/10.1016/S0955-7997(02)00152-2.

[3] N. J. Higham and S. Pranesh, Simulating low precision floating-point arithmetic, SIAM J. Sci. Comput., 41 (2019), pp. C585–C602, https://doi.org/10.1137/19M1251308.

License

This project is licensed under the terms of the License.