SciNim / nimblas

BLAS for Nim
http://scinim.github.io/nimblas
Apache License 2.0
42 stars 5 forks source link

Support sparse blas (spblas) #6

Closed chimez closed 5 years ago

chimez commented 5 years ago

Sparse blas is a part of BLAS Technical Forum Standard These libs should be support:

  1. librsb by default for its LGPLv3 license
  2. MKL for CPU
  3. cuSPARSE for GPU
andreaferretti commented 5 years ago

This library is about bindings to standard BLAS. I am interested in Sparse BLAS as well, but I could not find a common standardized interface like BLAS. I started doing something here as part of Neo, a higher level library, but it is just the beginning.

andreaferretti commented 5 years ago

(I closed the issue because it is not relevant to these bindings, but I would be interested in developing Sparse BLAS bindings as a separated library)

chimez commented 5 years ago

All right. Is unicredit an organization of nim math repositories? Will you create a "nimspblas" repository?

andreaferretti commented 5 years ago

No, Unicredit is a bank group :-) I can create a nimspblas repository, but at the moment I don't know what to put in there. You probably know much more than me on sparse BLAS. Is there a unified interface like BLAS? Do you have a reference for that?

chimez commented 5 years ago

sparse matrix has some format csr,csc,coo... However, handling format is library's job, so zgemv of blas will become mkl_sparse_z_mv of mkl and blas_zusmv of librsb. That seems easy.

[1] function list of mkl https://software.intel.com/en-us/mkl-developer-reference-c-inspector-executor-sparse-blas-execution-routines [2] function list of librsb https://home.mpcdf.mpg.de/~mima/librsb-1.2.0-rc4/doc/html/group__rsb__doc__sparse__blas.html

andreaferretti commented 5 years ago

I don't think I am in a position to create anything for sparse BLAS right now. Unfortunately, the differences between interfaces are too big (for instance, for matrix/vector product, compare the signatures in https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-mv and https://home.mpcdf.mpg.de/~mima/librsb-1.2.0-rc4/doc/html/group__rsb__doc__sparse__blas.html#gafb4d039eb5319613ed30db7fb323278c ). And this is without even considering the CUDA version.

All in all, I think the best way to proceed would be:

All of that is a lot of work, that I cannot commit to doing right now. It is an interesting project, and if it ever starts I'd be interested in integrating parts of it inside Neo, but if you are really interested in that, I suggest that you work on this yourself.

RoyiAvital commented 5 years ago

What's the difference between this and Neo?

By the way, any of them support Windows?

andreaferretti commented 5 years ago

This library is a binding for the BLAS interface. Neo is a higher level library about linear algebra, that uses this under the hood, as well as CUDA bindings and so on.

I think the libraries should work on Windows, but I do not use it, so I cannot tell you much more.