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
- MKL Packed Storage scheme for matrix with many zoroes

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

S__MPay

Beginner

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

07-24-2019
02:24 AM

132 Views

MKL Packed Storage scheme for matrix with many zoroes

I have a very large matrix but many of its members are zero however it does not have a specific shape like being banded, etc.

Is there any possibility that I can reduce memory usage for storing this matrix for using MKL to solve marix operations?

Currently for a not very large model I need more than 32GB of RAM.

1 Solution

mecej4

Black Belt

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

07-24-2019
07:30 PM

132 Views

Link Copied

4 Replies

jirina

Novice

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

07-24-2019
05:57 AM

132 Views

Have you considered the CSR (Compressed Sparse Row) format? See e.g. here.

S__MPay

Beginner

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

07-24-2019
07:15 PM

132 Views

jirina wrote:Have you considered the CSR (Compressed Sparse Row) format? See e.g. here.

Dear Jirina, Thanks that is what I am looking for but the only problem is that I assemble the matrix element by element and don't have values arranged by rows and columns. Do you know if there is a standard way to assemble the matrix using CSR format with minimum calculation cost?

mecej4

Black Belt

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

07-24-2019
07:30 PM

133 Views

Kirill_V_Intel

Employee

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

07-25-2019
08:45 AM

132 Views

mecej4 wrote:If you visit the elements in some arbitrary order and compute node-node coefficients, you may need to use the coordinate list format ("COO" format) and then convert to CSR format. See this thread: https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/... .

Or you can construct CSR with a hand-written routine without overhead of creating an intermediate COO representation. For this, you basically need to perform two passes through the data. On the first pass you create rowIndex (or pointerB and pointerE for 4-array CSR) by just looping over your tuples and counting number of nonzeros in each row. After the second pass you allocate colIndx and values and fill them during the second pass. During the second pass you can then use the offsets into colIndx and values from the pre-computed rowIndex.

This can be in many cases faster than creating a coordinate format and then converting it into CSR.

Best,

Kirill

- 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.