google-research / sputnik

A library of GPU kernels for sparse matrix operations.
Apache License 2.0
249 stars 50 forks source link

No user API to create a SparseMatrix object from float* A #13

Closed Summer-Summer closed 1 year ago

Summer-Summer commented 1 year ago

It seems that No user API is provided in your code to create a "SparseMatrix" object from a sparse matrix with a dense format (such as float A). Otherwise, I can not test the performance of your kernel with real sparse weight matrices. I have to write my own codes to generate the CSR format from float A, and then I have to generate the row indexes according to your row-swizzle policy.

Is my understanding correct or did I miss something in your code?

tgale96 commented 1 year ago

Hi! Yes, you will have to write your own code to convert to CSR.

For real sparse weight benchmarks we had the matrices stored in compressed format and loaded them directly into cpp.

Summer-Summer commented 1 year ago

Thanks for your timely reply. I have written my own code to generate a standard CSR format and I happily found that you already provided a function to convert a standard CSR format to your customized CSR format with row-swizzle and padding.