CExA-project / ddc

DDC is a discrete domain computation library.
https://ddc.mdls.fr
Other
30 stars 3 forks source link

Optimizing gemm usage in splines #524

Closed blegouix closed 1 week ago

blegouix commented 2 weeks ago

In SplinesLinearProblem2x2Blocks::solve(), two gemm operations are performed, involving bottom-left and top-right corners. Those are stored as dense matrix (2D Kokkos::View). However, the bottom-left corner contains a very small number of non-zeros (here 6 for a 4x96 block):

image

while the top-right corner has the following structure (once factorized as Q^-1*gamma):

image

Of course, dense storages for those blocks and dense gemm usage are suboptimal. We could consider improving this using conversion to sparse format (removing zeros) during factorization and using some spmv.

@yasahi-hpc

blegouix commented 2 weeks ago

I think this: https://github.com/kokkos/kokkos-kernels/blob/develop/sparse/src/KokkosSparse_spmv_team.hpp

Should suit the needs once we have the Csr