Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6957 Discussions

Dense matrix multiply tansposed Sparse Matrix?

Yiming_W_
Beginner
381 Views

Hi,

I want to use MKL Sparse to compute a dense matrix multiply transposed sparse matrix. Particularly, if I have input A(dense, m-by-k), B(sparse, n-by-k), I want to compute:

C = A * B'

where C is a m-by-n dense matrix. Notice that the position of matrix is different from what mkl_?csrmm(https://software.intel.com/zh-cn/node/520832) defines. I am thinking about transpose the A and C and transpose them back after computation. But there is too much memory consumption when A and C are both big. Any thoughts on that?

Thanks!

0 Kudos
1 Solution
Ying_H_Intel
Employee
381 Views

Hi Yiming, 

Thanks for letting us know. I may escalate the interface request to engineer team to consider in future version. You may use the  transpose + mkl_?csrmm + transpose for temp workaround. 

Best Regards,

Ying 

transpose, void mkl_simatcopy (const char ordering, const char trans, size_t rows, size_t cols,
const float alpha, float * AB, size_t lda, size_t ldb);

View solution in original post

0 Kudos
3 Replies
Ying_H_Intel
Employee
381 Views

Hi Yiming,

Right, it seems there is no suitable function to do such operation besides that either B transpose, or A transpose. .

C= A(dense)*B'(sparse)  or  C'=B(sparse)*A'(dense) is for mkl_?csrmm.

What is the range of the m, k, n? 

Best Regards,
Ying

0 Kudos
Yiming_W_
Beginner
380 Views

Hi Ying,

Thanks for replying. I think the M and N might be in the range of 1,000 to 50,000. Do you have any plan for providing any interface with sparse matrix on the right?

Thanks!

Yiming

Ying H. (Intel) wrote:

Hi Yiming,

Right, it seems there is no suitable function to do such operation besides that either B transpose, or A transpose. .

C= A(dense)*B'(sparse)  or  C'=B(sparse)*A'(dense) is for mkl_?csrmm.

What is the range of the m, k, n? 

Best Regards,
Ying

0 Kudos
Ying_H_Intel
Employee
382 Views

Hi Yiming, 

Thanks for letting us know. I may escalate the interface request to engineer team to consider in future version. You may use the  transpose + mkl_?csrmm + transpose for temp workaround. 

Best Regards,

Ying 

transpose, void mkl_simatcopy (const char ordering, const char trans, size_t rows, size_t cols,
const float alpha, float * AB, size_t lda, size_t ldb);

0 Kudos
Reply