Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Deepika
Beginner
153 Views

Intel MKL SpMM

Hi,

I was wondering if there is any way to know what matrix multiplication method/optimisation (inner-product, outer-product, row-wise product etc.) is used if I am using any sparse matrix-matrix multiplication routine in mkl, for example, mkl_sparse_spmm? And also, how is it decided and is there a way to control it, for example, if I want to use outer-product or row-wise product only how can I do that?

0 Kudos
8 Replies
ArpitaP_Intel
Moderator
115 Views

Hello Deepika,


Thanks for reaching out to us.


Intel oneAPI MKL provides us with a large range of Sparse BLAS Level 2 and Level 3 Routines.

Please check the below link

https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/...


Regarding

> matrix multiplication/optimisation used in sparse matrix-matrix multiplication routine in MKL

We are working on it internally; we will get back to you soon.


Regards,

Arpita


Kirill_V_Intel
Employee
95 Views

Hello!

There is no way to control the algorithm used, as of right now. I infer from your question that you are likely using CPU functionality. In this case, mostly commonly used methods are variants of Gustavson.

Could you please give us more details about why you want this control and in which case you want to use a particular method? 

If you are interested in having the feature with explicit control over the method used underneath mkl_sparse_spmm or mkl_sparse_sp2m, you can submit a feature request.

Thanks,
Kirill

Deepika
Beginner
88 Views

Hello!

Thank you for responding. I was trying to characterise different SpMM techniques for a course project. That's why I was checking if there is a way to control the algorithm used in MKL. Also, is there any subroutine in MKL that can help in estimating the size of the sparse product matrix given two input sparse matrices?

Thanks,

Deepika

Kirill_V_Intel
Employee
84 Views

Hello Deepika,

Please have a look at mkl_sparse_sp2m functionality, https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/.... It is an extended version of spmm.

In particular, it allows to do the matrix-matrix multiple in severl stages. The first of them will compute the rowStart/colStart array for the output matrix (when called with request=SPARSE_STAGE_NNZ_COUNT). So you can check the nnz in the output matrix before actually computing/allocating the arrays for column indices/values.

Best,
Kirill

Deepika
Beginner
78 Views

Thanks!

I will look at it.

Regards,

Deepika

ArpitaP_Intel
Moderator
53 Views

Hi,

If your query is resolved, could you please let us know if I can close this thread.


Regards,

Arpita



ArpitaP_Intel
Moderator
35 Views

Hi,


Hope we were able to resolve your issue. If you need any additional information, please submit a new query as this thread will no longer be monitored.


Regards,

Arpita


Deepika
Beginner
31 Views

Yes, you can close it.

Thanks!

Reply