Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all 2652 articles
Browse latest View live

Inconsistency finding Eigenvalues for sparse matrices with MKL

$
0
0

Hi,

I am trying to calculate the smallest real eigenvalues of a general problem A*V = B*V*D with sparse matrices using MKL and I have been having four problems when comparing to MATLAB:

1. I am always missing at least one of the smallest eigenvalues in MKL in comparison to MATLAB.

For example

2. Using the same matrix most of the eigenvalues I do get are almost Identical between MATLAB and MKL, but which of the eigenvalues I am missing is somewhat random.

Same System, different results

3. The smallest eigenvalue tend to be a several orders of magnitudes different between MATLAB and MKL (in some unfrequent cases not only the first)

MATLAB both Graphs: -0.000200            

MKL first graph:          380057.918617          

MKL second graph:     364053.320270

4. For some sparse matrices describing a very similar system with similar sparcity but different non-zero values I get no eigenvalues on MKL but several hundreds on MATLAB

I attached all data needed to reproduce my results in two Zips docs

Could somebody help me understand what I might be doing wrong or what alternative could I use to solve the problem

Thanks a lot

Andrés Delgado


Memory leak in 'dsygv' of latest MKL

$
0
0

Dear all,

I build my 64 bit program under Windows 10 64 bit + VS2017 + Intel Parallel Studio 2019 update 4, I found the program has the memory leak problem. I checked by Intel Inspector and found that it pointed to 'dsygv' function. I changed the MKL to 2017 version and found this problem doesn't exist. Could anyone help me to take a look at it?

 

Thanks,

Tang Laoya

 

AttachmentSize
Downloadimage/pngmemoryleak.png44.2 KB

Confused About MKL Linking Warnings/Errors w/Visual Studio 2015

$
0
0

Hi, I'm updating my static library from a very old version of MKL (circa ~2010) to MKL version 2019 Update 3.  I'm using Visual Studio 2015.  The only changes I made to my existing codebase was to include the new headers, change a call in my code from MKL_FreeBuffers() to mkl_free_buffers() and link to mkl_intel_c.lib, mkl_sequential.lib and mkl_core.lib as told to do by the Intel Math Kernel Library Link Line Advisor.  However, when building, I get a couple hundred warnings like this:

mkl_core.lib(_avx2_set_codelet_cb.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library

But, if I no longer link in mkl_core.lib, I'll get 468 unresolved external symbols errors like this:

error LNK2001: unresolved external symbol _mkl_serv_inspector_loaded

Can anyone explain this?  Clearly it seems mkl_core.lib is needed, so I'm not sure why I'm getting those warnings...

Missing SONAME for libmkl_rt.so / 2019.0.4

$
0
0

Hey there,

the current version (2019.0.4) of libmkl_rt.so has no SONAME set. This leads to various minor linking issues, as ld/cmake then places the absolute path in the DT_NEEDED ELF field, instead of only "libmkl_rt.so". That again is a problem in deployments.

Would it be possible to get SONAME set to simply "libmkl_rt.so" in an upcoming version?

Probably it would be best to do it for all dynamic mkl libraries.

Currently only the following libs have a SONAME:

libiomp5_db.so
libiomp5.so
libiompstubs5.so
libmkl_vml_avx2.so
libmkl_vml_avx512_mic.so
libmkl_vml_avx512.so
libmkl_vml_avx.so
libmkl_vml_cmpt.so
libmkl_vml_def.so
libmkl_vml_mc2.so
libmkl_vml_mc3.so
libmkl_vml_mc.so

If there is a better way to express this request for the free edition of MKL, please tell me.

Thanks,
Sebastian

scalapack psgemm fails

$
0
0

Hi. 

I want to use psgemm to multiply a matrix A by its transpose on its left-hand-side, namely: C = At * A

I am trying to run a simple program with 9 processors placed in a 3x3 grid. Each processor generates a random square matrix, Ablock, of size block_dim x block_dim (choosing here block_dim = 10), that is a submatrix of A. Hence the global matrix A is a 30x30 matrix. 

myrow and mycol are the row and column grid indexes of processors. 

idesca and idescc are the descriptors of matrices A and C. 

C is initialized as a block_dim x block_dim array. 

I call psgemm as follows, but I get a segmentation fault:

psgemm_('T', 'N', block_dim, block_dim, block_dim, &one, Ablock, myrow * block_dim, mycol * block_dim, idesca, Ablock, myrow * block_dim, mycol * block_dim, idescal, &zero, C, myrow * block_dim, mycol * block_dim, idescc);

what am I doing wrong?

Intel MKL support OS & CPU Generation

The command "..." exited with code 1

$
0
0

I recently downloaded the mkl and tried to test it using a simple code.  When I build it however, I get a message saying: the command … exited with code 1. Anyone know how to fix it?

Bug in mkl_sparse_spmm (?)

$
0
0

Hello,

I am finding very strange results from mkl_sparse_spmm()

My code looks like below.

The strange thing is:

1. if I pass the routine a "small" pair of sparse matrices (A[m x k] dot B[k x n], m = 40,000, k = 1000, n = 40,000, sparsity is ~ 99% and 65% for B and A, respectively), then the result is correct; by correct, I mean that the diagonal of the resultant sparse matrix has the correct spectrum (known a priori), and element by element comparison to the result from scipy.sparse matrix product is within floating point error

2. however, if I pass it a larger pair of matrices (m ~ 70k, n ~ 70k, similar sparsity) then the result is strange; notably, "number of 0 elements" printed in the code is almost as large as the total number of elements returned (i.e., rows_e[n-1] - nzero ~ few 10k out of O(100M) total), which means that mkl_sparse_spmm is reporting a large number of non-zero elements that are actually set to zero in the output array; the diagonal elements are all crazy, and comparison to scipy.sparse matrix product is waaaay off

Are there any guesses what I might be doing wrong? Here are my compiler settings (gcc v6.3):

CFLAGS = -march=native -m64 -fPIC -O3 -fopenmp -DMKL_ILP64

LDFLAGS = -pthread -L$(EXTERN)/usr/lib -lgomp -lboost_python -lboost_numpy -lpython$(PYVERS) \
                  -L/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64 \
                  -lmkl_intel_ilp64 -lmkl_core -lmkl_def -lmkl_rt -lmkl_gnu_thread

 

SYSTEM: MKL version is 2019.4.243; system is Intel(R) Xeon(R) CPU E5-2630 v4 dual socket with 64GB RAM, g++ (GCC) 6.3.0 / CENTOS 7

Output on the Python side:

                                                                                                                               
G shape = (1296, 64827)                                                                                                                                           
Range(G) = [3.76e-06, 4.31]                                                                                                                                       
Sparsity of G = 99.721%                                                                                                                                              
Sparsity of G_g[64827 x 1296] = 0.529                                                                                                                             
Range of G_g = [-0.00227, 0.000266]                                                                                                                               

>>>  p = numeric.mkl.sp_mm_csr(m, k, n, G_g.count_nonzero(), G_g.data, G_g.indptr.astype(int), G_g.indices.astype(int), G.count_nonzero(), G.data, G.indptr.astype(int), G.indices.astype(int))
number of 0 elements: 881856376                                                                                                                                                         
                                                                                                                                                                         
>>> Rp = csr_matrix(p(), shape=(m,n))                                                                                                                             
>>> Rp.count_nonzero()                                                                                                                                            
9134960                                                                                                                                                           
>>> R = G_g * G                                                                                                                                                   
>>> R.count_nonzero()                                                                                                                                             
890991336

## NOTE: 890991336 - 9134960 = 881856376

 

Somewhat redacted C++ side code is below (I don't think I have removed anything that is relevant ...).

 

sp_mm_csr(MKL_INT m, MKL_INT k, MKL_INT n, MKL_INT nnz_a, np::ndarray a_vals, np::ndarray a_rows, np::ndarray a_cols, MKL_INT nnz_b, np::ndarray b_vals, np::ndarray b_rows, np::ndarray b_cols) {

      // np::ndarray are boost::python::numpy arrays; omitted code ensures that 
      // all arrays have correct types (np.int64 and double) and dimensions

      mkl_sparse_d_create_csr(
        &csr_a, SPARSE_INDEX_BASE_ZERO, m, k,
        reinterpret_cast<MKL_INT *>(a_rows.get_data()),
        reinterpret_cast<MKL_INT *>(a_rows.get_data()) + 1,
        reinterpret_cast<MKL_INT *>(a_cols.get_data()),
        reinterpret_cast<sp_mm_csr_res::real_t *>(a_vals.get_data()));

      mkl_sparse_d_create_csr(
        &csr_b, SPARSE_INDEX_BASE_ZERO, k, n,
        reinterpret_cast<MKL_INT *>(b_rows.get_data()),
        reinterpret_cast<MKL_INT *>(b_rows.get_data()) + 1,
        reinterpret_cast<MKL_INT *>(b_cols.get_data()),
        reinterpret_cast<sp_mm_csr_res::real_t *>(b_vals.get_data()));

     sparse_matrix_t csr_c = NULL;
     auto status =
        mkl_sparse_spmm(SPARSE_OPERATION_NON_TRANSPOSE, csr_a, csr_b, &csr_c);

    // m_XX variables are all MKL_INT or real_t = double class members

    MKL_INT *rows_b;
    MKL_INT *rows_e;
    mkl_sparse_d_export_csr(csr_c, &m_indexing, &m_nrows, &m_ncols, &rows_b,
                            &rows_e, &m_mat_cols, &m_mat_vals);

    m_nnz = rows_e[m_nrows - 1];

    MKL_INT nzero = 0;
    for(MKL_INT i=0; i < m_nnz; ++i) {
      if ((*(m_mat_vals + i)) == 0) {
        nzero += 1;
      }
    }
    std::cout << "number of 0 elements: "<< nzero << std::endl;

    // ... 
}

 


mkl_sparse_d_spmmd does not support CSC matrices?

$
0
0

Hello

So I created a handle for matrix A (MwqTHandle) in CSR form and a handle for matrix B in CSC form. I tried to multiply these two together using mkl_sparse_d_spmmd. Status was reported as success, but actually all it did is turn the resultant dense matrix to zeroes. Is this not supported? If I make B in CSR form it works however, but this seems inefficient to multiply a CSR matrix by a CSR matrix, surely CSC for the second form is more logical as the columns of the second matrix need to be accessed (or CSR by CSR if the second matrix is to be transposed, but there is no option to do this in spmmd!)

 

I tried doing this with mkl_sparse_spmm and storing the result as a sparse matrix instead, but the code said this was not supported. I tried doing it with mkl_sparse_sp2m and this also does not work with CSR + CSC combination. However it does work with CSR + CSR and allows me to transpose the second matrix, meaning that is essentially achieves the same goal. So I am happy to use that workaround if I want to store the result as sparse, but if I want to store the result as dense is there a workaround to this problem? Perhaps an sp2md that allows transposition of the second matrix?

I tried to upload my source code but not sure if that worked correctly. Please let me know if it hasn't uploaded correctly.

Regards, Luke Mazur

MKL on Celeron processor?

$
0
0

・Does MKL support Intel Celeron processors?

・How does MKL behave on Celeron? 
     for example  3000 series    (Celeron G3900)

I found  about supported hardware about mkl,but celeron was not listed...
   https://software.intel.com/en-us/mkl

 

Thank you.

Error in PARDISO 6.0

$
0
0

Hi!

I am a new user of PARDISO 6.0 . Recently I am trying to compile " pardiso_sym.f " which is downloaded from www.pardiso-project.org. I got some errors. 

 [PARDISO]: License check was successful ...
*** Error in PARDISO  ( sequence_ido,parameters) error_num= 15
*** Input check: matrix_type_new 0 (out of bounds)
*** Input parameters: inconsistent error= 15 max_fac_store_in: 1
          matrix_number_in: 1 matrix_type_in: 0
          ido_in                  : 11 neqns_in      : 8
          ia(neqns_in+1)-1: 18 nb_in            : 1
 Reordering completed ...
 The following ERROR was detected:           -1
Press any key to continue . . .

Could you give me some suggestion and help? Thank you very much for your kindness.

Sincerely,

BaLL

AttachmentSize
Downloadapplication/octet-streampardiso_sym.f6.69 KB

Does not dealllocate memory

$
0
0

Hello everyone,

 

I have an application where I have to create some worker threads. These threads call a function inside a dll, where mkl is used.

I have read some articles about memory leaks, and they advise to use these functions:

    MKL_Disable_Fast_MM();
    mkl_disable_fast_mm();

    MKL_Thread_Free_Buffers();
    mkl_thread_free_buffers();

 

But they are not changing anything, so the memory is still not deallocated. 

 

Any solution? There is another topic (https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/...), that seems to be the same problem as mine.

 

Thanks you very much,

MKL BLAS causes Intel i9 9900K to crash/reboot(?)

$
0
0

Running under Linux Ubuntu 18.04 with standard/default BLAS library I observe normal behavior.  If I install a parallelized BLAS library such as MKL or openblas, any simple matrix operation causes the machine to shut down and reboot immediately.  Behavior occurs on a System76 Thelio desktop with Intel i9 9900K processor, and confirmed observed by System76's own technicians.  Behavior does not occur on comparable AMD processor in the same machine.  

 

To reproduce from a fresh ubuntu 18.04 install: If I install python3, numpy, and MKL (e.g. following http://dirk.eddelbuettel.com/blog/2018/04/15/) and try some parallel matrix algebra, e.g. on Python following http://hduongtrong.github.io/2016/03/07/Matrix-Multiplication-Benchmark/, the machine crashes/reboots. Identical behavior occurs doing the an parallel matrix algebra in R, so is not software-specific. 

 

As best as I can tell, this seems to be due to the Intel i9 9900K itself when running parallelized BLAS (including but not limited to MKL), but I am unsure how to properly document and report this issue.  Any suggestions would be appreciated.  

cblas_daxpy gives wrong results with multuple threads

$
0
0

Hello,

I have installed the most recent version of MKL and tried to use in my application built using VS 2015 C++. Certain parts of my code use OMP. However, I never call MKL routines from within an OMP block. My problem is that unless I disable OMP, or run on 1 thread, I keep getting wrong results. This was not the case in the past when  I was using an older (about 10 yrs ago) version of MKL together with VS2008.

 I wonder if there is any solution that allows my VS 2015 C++ application to keep OMP and run MKL routines.

Thank you!

Hussein

 

 

weighted sum of two matrices

$
0
0

How do I do this using Intel MKL?

res(:,:,:,i+j+k) = var(:,:,:,1)*op(1)+var(:,:,:,2)*op(2)

In this example, 'res' is a matrix with 4 dimensions, of which the last one is only two.

'op' is a vector two elements long.

I have found  https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-mm which is good as there are two scalars which the matrices are multiplied by. However, there is A, B, and C in the documentation whereas I have only two matrices.

Also if you could please recommend some literature that introduces me to Intel MKL with problem sets to practice by myself, I would be happy to give it a go. I find Intel MKL confusing and now I get most of the answers by searching 'do something intel mkl' replacing 'do something' with what I need. Perhaps this is not very efficient...


SGEMV and SGEMM performance degradation on Xeon E5-2609

$
0
0

Hi,

We have noticed a performance problem on a particular CPU (Xeon(R) CPU E5-2609 0 @ 2.40GHz) that we have narrowed down to a change in either SGEMV or SGEMM (or both) that occurred somewhere between MKL 11.2 Update 2 (Product build 20150120) and MKL 2018.0 Update 1 (Product build 20171007) on Windows. The slowness (relative to 11.2) still exists in MKL 2019.0 Update 4. We are using the 32-bit versions of the libraries.

Is there any known change or issue in MKL that could account for this behavior? If so, can anything be done about this? Any amount of help would be appreciated.

Thanks!

-Jake

Error making custom blacs library on MacOS with openmpi

$
0
0

I was trying to make the custom blacs library (after successfully doing this last year) and just received this error:

sudo make libintel64 interface=lp64
Password:
/Applications/Xcode.app/Contents/Developer/usr/bin/make clean mkobjdir wraplib ILP_EXT=_lp64 _IA=intel64
rm -rf ./obj_lp64
rm -f ../../lib//libmkl_blacs_custom_lp64
mkdir -p ./obj_lp64
mkdir -p ../../lib/
mpicc -c -Wall -fPIC     -I../../include mklmpi-impl.c -o obj_lp64/mklmpi-impl.o
mklmpi-impl.c(87): error: identifier "MPI_UB" is undefined
      RETURN_IF(xdatatype,MPI_UB);
      ^

I think this is because I'm now using openmpi 4.0.1 and MPI_UB is no longer supported.

Workaround is to comment out line 87 in mklmpi-impl.c.

Also for reference for others trying to get mpich or openmpi compiled on recent versions of Mac OS:

  •  the current version of mpich does not compile on Mac OS 10.14.5 with intel compilers 19.0.4, hence why I'm building the openmpi custom blacs rather than using the mpich version that ships with the mkl.    
  • to compile openmpi on Mac OS 10.14.5 with intel compilers 19.0.4 you need to add   --disable-dlopen  when running the configure script otherwise you'll get errors down the road when trying to build and run executables:
    • ./configure --disable-dlopen 

       

 

Pardiso matrix size change over the simulation

$
0
0

Dear all, 

I have just started learning PARDISO and I face a question:

How can we use PARDISO when our coefficient matrix size changes over the simulation?

I know that we can simply solve this issue by reinitializing PARDISO but maybe a special order of steps needs to be followed to avoid this inefficient using of PARDISO.

Thanks.

Versions older than 2017 available?

Any routines for sparse symmetric matrix-matrix production?

$
0
0

Hi,

I notice that MKL has special support for symmetric dense matrix production. Also MKL inspector-executor sparse BLAS routine supports sparse matrix-matrix production. My task is to conduct matrix production of two sparse symmetric matrix. I am wondering if there is any special routines supporting for this kind of special case?

 

Thank you very much!

Viewing all 2652 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>