Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Sparse Matrix Matrix Multiplication

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Ferdous__S_M

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-12-2020
06:44 PM

138 Views

Sparse Matrix Matrix Multiplication

I have a matrix A I want to perform the following operation in MKL,

C = A^{T}

Where A is a sparse matrix and A^{T} and then multiplying it using **spmmd. **Note that C is a dense matrix. But this approach wastes memory because I need to compute A^{T }separately. Is there any specific function in MKL that I can use for this?

Link Copied

3 Replies

Kirill_V_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-13-2020
12:00 PM

138 Views

Hello,

Have a look at mkl_sparse_?_syrkd, https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-syrkd. Isn't it what you're looking for?

Best,

Kirill

Ferdous__S_M

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-13-2020
12:58 PM

138 Views

^{T}. But I do not want to compute it. What I need is a subset of the rows of A times the transpose of A. I do not see how I can use syrkd for achieving this.

Kirill_V_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-13-2020
10:55 PM

138 Views

I see, I didn't notice it. So, I guess then that h is relatively small, right? (if it was comparable with the size of the matrix you could use syrk and then throw away the part which is not needed).

If h is very small, you might consider conveting A(1:h,:) and the resulting matrix to a dense format, and make use of mkl_sparse_?_mm (and use an extra transposition of the result). Say, if A(1:h,:) = B (dense), you can write A(1:h,:)*A^T = B * A^T = (A * B^T)^T, so you can transpose B while converting A(1:h,:) to the dense format, compute the result using mm and then transpose the (skinny, dense) matrix product to get the final result (in the dense format).

You can also try to play around with CSR/CSC formats and transposition to avoid transposing the matrix A at the cost of transposing the other objects (similar to what I describe above) but I am not sure it will bring you a lot of benefits.

Also, if you tell us more about your use case and why it happens to be something important ~ critical for performance, we can add it to the list of feature requests.

Best,

Kirill

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.