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

cgemm3m, cgemm_compact AND cgemm give poor results for small problem 24*64

$
0
0

Hi all,

I using sequential API and direct call to multilply matrices.

 C = 1*conj(A')*A

A is 64*24 and C is 24*24 both are complex matrix (complex8).

I have arrays of matrices: A_ARR (filled with random values) and C_ARR (filled with zeros) both array have 1000 matrices.

My application is pinned to sinlge core and to corresponding RAM by NUMA id.

build cmd: icc -c -g -ipo -ipp -Ofast -DMKL_DIRECT_SEQ -xCORE-AVX2 *.c

Setup is Xeon E5-2699A v4,  64G ram on each numa

I run cblas_cgemm/cblas_cgemm3m/mkl_cgemm_compact in a loop over A_ARR and C_ARR (each time only 1 function) and I get really poor results (I'm measuring only the matrices multiplication time) 

I'm aware to the MKL "warn-up" issue and running cblas_cgemm in advance with measuring it time

cblas_cgemm(CblasRowMajor, CblasConjTrans, CblasNoTrans, m, n, k, &alpha, &A_ARR[i], m, &A_ARR[i], n, &beta, &C_ARR[i], m)

Gives- AVG 6.5ms MAX 8.6ms MIN 6.3ms

cblas_cgemm3m(CblasRowMajor, CblasConjTrans, CblasNoTrans, m, n, k, &alpha, &A_ARR[[i], m, &A_ARR[[i], n, &beta, &C_ARR[[i], m)

Gives- AVG 7.5ms MAX 12ms MIN 7.3ms

mkl_cgemm_compact(CblasRowMajor, CblasConjTrans, CblasNoTrans, m, n, k, &alpha, &a_arr_compact[[i], m, &a_arr_compact[i], n, &beta, &c_arr_compact[[i], m, COMPACT_FORMAT, 1) 

Gives- AVG 225ms MAX 231ms MIN 224ms

Note COMPACT_FORMAT is from mkl_get_format_compact();

Does any one can assist me with reducing with time it takes? 

It is also not clear to me why the compact API that should mostly vectorize  matrices multiplication it getting lowest results

 

Thanks

 

Elad

 

 


Viewing all articles
Browse latest Browse all 2652

Latest Images

Trending Articles



Latest Images

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