Notes on other libraries' (sparse) TRSM APIs #129
rileyjmurray
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The TRSM API was harder to design. It might change in the future.
Here are some notes that might be relevant to that future planning.
Big design considerations.
operations with submatrices. New SparseBLAS, Intel MKL, AOCL, and cuSPARSE support
operating on submatrices. The conventions are clearlest in Intel docs:
https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2025-0/interface-consideration.html#GUID-0C896CB1-25B6-4B53-A425-C5954B4C22F9
^ My feeling is that Intel's conventions are very cool, but I should punt on this.
The New SparseBLAS approach isn't that complicated and we could offer something
like it in the future.
Need to figure out if/how API incorporates "diag" and "uplo."
How other libraries handle UPLO and DIAG.
oneAPI : uplo and diag explicit arguments.
--> Does have a "diag" parameter. Definition at
https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.3-rev-1/elements/onemkl/source/architecture/architecture#onemkl-enum-diag
implies entries exist in the sparsity structure but are not accessed if diag==unit.
--> Seems the only supported storage format is CSR?
https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.3-rev-1/elements/onemkl/source/domains/spblas/format-descriptions
New SparseBLAS : uplo and diag explicit arguments.
has "DiagonalStorage", which can take one of the values here
https://github.com/SparseBLAS/spblas-reference/blob/c512782a5dcba208441eae665efd43883a9230ad/include/spblas/detail/triangular_types.hpp#L15-L23
structurally triangular. No specific assumption about the diagonal being stored is made
when diag != explicit. Any diagonal that is stored is ignored if diag != explicit.
Intel MKL : uplo and diag in "desc" argument.
--> No "diag" parameter. Only a "desc" parameter.
--> See "Operations with Partial Matrices."
diagonal elements must be stored in the sparse representation even if they are zero.
In all other formats, diagonal elements can be stored (if needed) in the sparse
representation if they are not zero.
AOCL : uplo and diag in "desc"
https://github.com/amd/aocl-sparse/blob/master/library/src/level3/aoclsparse_trsm.hpp
https://github.com/amd/aocl-sparse/blob/e9645d728d5698642f686e6f6e25df63cc4c17f6/library/src/level2/aoclsparse_trsv.hpp#L734-L1102
which does have a matrix descriptor that stores information about being upper or lower, etc...
cuSPARSE : uplo and diag in "desc"
but only the upper or lower triangular part is taken into account
in the computation."
sparse matrix handles include a diag descriptor
https://docs.nvidia.com/cuda/cusparse/index.html#cusparsespsv
ARM Performance Libraries :
https://developer.arm.com/documentation/101004/2410/Sparse-Linear-Algebra/Sparse-Linear-Algebra-Functions/armpl-spsv-exec-d?lang=en
Kokkos
https://kokkos.org/kokkos-kernels/docs/API/sparse/sptrsv_solve.html
https://kokkos.org/kokkos-kernels/docs/API/sparse/handle_get_create_destroy.html#sptrsv
for what can be stored in an operation-specific sparse matrix handle,
along with
https://kokkos.org/kokkos-kernels/docs/API/sparse/CrsMatrix_constructors.html
SuiteSparse's CXSparse : uplo handled by function name.
https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CXSparse/Source
Beta Was this translation helpful? Give feedback.
All reactions