fromLAPACK band matrix

41 views
Skip to first unread message

Baptiste Legouix

unread,
Jul 5, 2023, 6:34:14 PM7/5/23
to SLATE User
Hello,

I have a code working on CPU based one Lapack dgbtrs. I would like to use Slate to beneficy from GPU, but I have difficulties to pass my matrix - stored in Lapack format - to Slate solver.

I understand i works with Tiles, so the storage is a bit more complicated than the simple Lapack format. However I wonder if I should write my own code to build those tiles, because fromLAPACK is not available for BandMatrix.

Can you explain why fromLAPACK is not available and what is the recommended way to build the Tiles and fill the BandMatrix ?

Regards,

Mark Gates

unread,
Jul 6, 2023, 3:31:55 PM7/6/23
to Baptiste Legouix, SLATE User
On Wed, Jul 5, 2023 at 6:34 PM Baptiste Legouix <stil...@gmail.com> wrote:
Hello,

I have a code working on CPU based one Lapack dgbtrs. I would like to use Slate to beneficy from GPU, but I have difficulties to pass my matrix - stored in Lapack format - to Slate solver.

When you say LAPACK format, do you mean a full, m-by-n matrix that happens to be banded, so everything outside some bandwidth is explicitly stored as zeros, as `dgesv` would take? Or do you mean LAPACK's band format, which stores diagonals of the matrix as rows in a (kl + ku + 1)-by-n matrix, as `dgbsv` would take?

What matrix dimensions and bandwidth do you have?

You can see in slate/test/band_utils.hh some utilities that we've used for testing. We haven't developed these to the point of including them in the SLATE library, but eventually could if something like that is beneficial.

Mark

--
Innovative Computing Laboratory
University of Tennessee, Knoxville

Baptiste Legouix

unread,
Jul 6, 2023, 6:24:17 PM7/6/23
to SLATE User, mga...@icl.utk.edu, SLATE User, Baptiste Legouix
I meant LAPACK format as dgbsv would take. I dont think the routines are really helpful because they all take a full matrix as input.

It is hard to give values for matrix dimension and bandwidth because our problem must be highly scalable. But I can say that the band will be very narrow compared to the full matrix size, which implies storing all the zeros is excluded.

You never had before the need to build the SLATE band matrix from an array in which only the band is stored ? If so, could you indicate which SLATE classes and functions I should consider using if I want to develop such a fromLAPACK function to convert the dgbsv format to slate::BandMatrix ?

Mark Gates

unread,
Jul 13, 2023, 11:08:15 AM7/13/23
to Baptiste Legouix, SLATE User
from(Sca)LAPACK create a SLATE matrix with tiles that point to existing (Sca)LAPACK data. The data isn't copied, it is updated in-place. This is not possible with the LAPACK band format, since that format is incompatible with SLATE's format. Instead, we would need to copy data from the LAPACK format to SLATE's format. So I wouldn't call it fromLAPACK, maybe copy_from_lapack instead. While from(Sca)LAPACK are member functions of the classes, copy routines are non-member functions.

Also, fromLAPACK is a little odd in that it assumes the matrix is replicated on all MPI processes, which isn't scalable. It was mainly implemented for debugging purposes. Whereas fromScaLAPACK takes data that is distributed. If you are running on only one MPI process, they should be equivalent.

We haven't really developed the band routines a lot — generally only as needed. Feel free to develop things and contribute to SLATE.

Mark

Reply all
Reply to author
Forward
0 new messages