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

mkl_sparse_spmm: Internal memory allocation failed.

Sid
Beginner
2,428 Views

Hi There,

I'm trying to debug why mkl_sparse_spmm returns with SPARSE_STATUS_NOT_INITIALIZED status and a system with plenty of free memory. Would appreciate help on this.

Thanks,

0 Kudos
12 Replies
MariaZh
Employee
2,428 Views

Hello,

Can you please provide more details about the way you use mkl_sparse_spmm and the MKL version?
I'd also appreciate if you attach a small reproducer so that I'll be able to investigate this case thoroughly.

Best regards,
Maria

0 Kudos
Gennady_F_Intel
Moderator
2,428 Views

Please take a look at the example - mklroot\examples\spblasc\source\  sparse_spmm.c Everything works as expected with 2018 u1. 

 

0 Kudos
Sid
Beginner
2,428 Views

Thanks, I'm going to upgrade to 2018u1 and give it another try.

0 Kudos
Sid
Beginner
2,428 Views

Here is an example that fails with allocation failure: https://gist.github.com/sgolestane/a24265a0d0c04db3d31ec2c4b6e6b672 It may be coincident that the result of the calculation is an all zero matrix.

0 Kudos
MariaZh
Employee
2,428 Views

Hello Sid,

Thank you for pointing out the issue with zero resulting matrix. 
Also initially you were speaking about returned status SPARSE_STATUS_NOT_INITIALIZED, does this problem still exist?

Best regards,
Maria

0 Kudos
Sid
Beginner
2,428 Views

Hi Maria,

Yes. mkl_sparse_spmm returns with status SPARSE_STATUS_NOT_INITIALIZED when the result matrix is zero.

 

0 Kudos
Gennady_F_Intel
Moderator
2,428 Views

I checked with MKL 2018 u2 and don't see this problem. 

............................
row#15: (0.160000, 3) (0.934000, 18) (0.664000, 19) (0.671000, 21) (0.566000, 23) (0.195000, 27)
row#16: (0.072000, 1) (0.126000, 11)
_______________ Compute C = A * B _________________
Status: 2
Error after MKL_SPARSE_SPMM
 
 
0 Kudos
Sid
Beginner
2,428 Views

Hi Gennady,

I just installed MKL 2018 u2 for macos (m_mkl_2018.2.164.dmg) and still getting status 2:

➜  source /opt/intel/bin/compilervars.sh -arch intel64 -platform mac; DYLD_LIBRARY_PATH="/opt/intel/mkl/lib";gcc -fsanitize=address -lmkl_rt  -lm -o test_mkl_sparse_spmm test_mkl_sparse_spmm.c
➜ ./test_mkl_sparse_spmm
 COMPUTE  A * B = C, where matrices are stored in CSR format

 MATRIX A:
row# : (value, column)
row#1:
row#2: (0.216000, 8)
row#3:
row#4:
row#5:
row#6:
row#7:
row#8:
row#9:
row#10:
row#11:
row#12:
row#13:
row#14:
row#15:
row#16:
row#17:
row#18:
row#19:
row#20:

 MATRIX B:
row# : (value, column)
row#0: (0.227000, 5) (0.716000, 12) (0.696000, 17) (0.172000, 19)
row#1: (0.767000, 17)
row#2: (0.095000, 6) (0.773000, 16) (0.117000, 22)
row#3: (0.233000, 6) (0.044000, 7) (0.646000, 16)
row#4: (0.100000, 10)
row#5: (0.498000, 2) (0.757000, 22) (0.676000, 27)
row#6: (0.016000, 1) (0.027000, 26)
row#7:
row#8: (0.572000, 11) (0.457000, 12) (0.018000, 17) (0.070000, 19) (0.088000, 20) (0.791000, 22)
row#9: (0.968000, 7) (0.698000, 11)
row#10: (0.439000, 2) (0.098000, 5) (0.843000, 7)
row#11: (0.165000, 4) (0.175000, 20)
row#12: (0.039000, 12) (0.902000, 16) (0.101000, 21) (0.806000, 27)
row#13: (0.933000, 2) (0.975000, 10) (0.406000, 13)
row#14: (0.463000, 10) (0.302000, 25)
row#15: (0.160000, 3) (0.934000, 18) (0.664000, 19) (0.671000, 21) (0.566000, 23) (0.195000, 27)
row#16: (0.072000, 1) (0.126000, 11)


_______________ Compute C = A * B _________________

Status: 2
Error after MKL_SPARSE_SPMM
 Error after MKL_SPARSE_DESTROY, csrC

 

0 Kudos
Gennady_F_Intel
Moderator
2,428 Views

thanks Sid. the case is escalated and we will keep you updated with the status of this issue.

0 Kudos
Sid
Beginner
2,428 Views

Hi Gennady,

Any update on this?

Thanks

0 Kudos
Gennady_F_Intel
Moderator
2,428 Views

hi Sid, the problem is fixed. The fix would be available in coming mkl v.2019 and v.2018 update 4. In the case if you have access to the Intel Online Service Center, we may share the engineering build for evaluation.

0 Kudos
Sid
Beginner
2,428 Views

Thanks for the update. I'll wait for the release. I

0 Kudos
Reply