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

Hi,

when trying to use "mkl_sparse_d_create_csr" on a sparse matrix which contains only zeros, I get the error "sparse_status_not_initalized".

The structure of the matrix is:

- size of rowindex array is n_rows + 1
- size of column index array is zero
- size of value array is zero

Is this a bug or wanted?

From an application perspective it is undesirable!!

Cheers

Link Copied

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

Hi Karl,

Thanks for reaching out to us.

The error "sparse_status_not_initalized" indicates that * the routine encountered an empty handle or matrix array* as per the MKL documentation https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/blas-...

*>>From an application perspective it is undesirable!!*

It would be great if you let us know your use case in which you are using a sparse matrix with only zeros along with a sample reproducer so that we can test it from our end as well.

Regards,

Vidya.

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

Hi Karl,

As we haven't heard back from you, could you please provide us with an update regarding the issue?

Regards,

Vidya.

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

Hi Karl,

As we haven't heard back from you we are closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.

Regards,

Vidya.

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

Hi may_ka,

This is a tricky case to handle well in C/C++. The main reason it is tricky, is that an array of length zero is the same thing as an array that is uninitialized (ie NULL) when dealing with allocated pointers. We have checks in our function that initialized arrays are being passed in to be set and the current assumption is that if the array is null, then it was a mistake (unintentional) to pass it in.

I wonder what application should support an empty sparse matrix (ie a zero matrix) ? Can you tell me more about where this could come up and why it should be handled at mkl level instead of application level ?

A workaround to create a functional zero matrix could be to create an array of length 1 or anything larger than 0 (so that the allocator succeeds in allocating space) for each of your colind and values arrays (initialize them to whatever you like), and then if rowptr is initialized to all 0s, those other arrays will never be used, but it will function in mkl calls as you expect (even if it will check all the rowptr values, and so is an O(nrows) operation for anything you want to do).

Hope this helps, but look forward to hearing more about when this comes up

Best,

Spencer

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

Hi @Spencer_P_Intel ,

I think the use case is actually valid and the lack of support in MKL is an artificial limitation (checks might affect performance of course but will it really?) rather than a necessity.

E.g., imagine a matrix-based algorithm which is written as:

C = 0

for i in 1, 2 ...N

C += A_i*B_i

or anything like that.

Alternatively, a zero matrix can appear in runtime with a non-analytical expression for the nnz so that the user might not know exactly that the matrix to be created has zero elements.

Of course, it would be an illegal matrix if rowptr is NULL but this is not the case as I understand.

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