Software Archive
Read-only legacy content
17061 Discussions

MKL BLAS function only run 1 thread on MIC

lu__shengliang
Beginner
290 Views

Hi,

I am trying to use MKL routines on MIC.

But I noticed that the performance is slower than my CPU version. And there are only 1 thread running.

Is that limited by MKL? I did some settings on the environment variables.

__attribute__(( target (mic) )) void offload_check(void) {
#ifdef __MIC__
        printf("Check Func: Run on MIC!\n");
#else
        printf("Check Func: Run on CPU...\n");
#endif
}


#pragma offload target(mic:0)           \
        in(A:length(A_m*A_n))           \
        in(B:length(B_m*B_n))           \
        inout(C:length(C_m*C_n))
        {
                offload_check();
                cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, A_m, B_n, B_m, \
                            alpha, A, A_n, B, B_n, beta, C, C_n);
        }
}

What I'm doing here is matrix multiplication. The N, M, K for matrix is 2048.

Is it because my matrix is too small and data transmission takes a lot of time? I'm running it on a single node belonging to a cluster, where I could not use vtune to profile it...

 

Thanks for your help

0 Kudos
4 Replies
Kevin_D_Intel
Employee
290 Views

Please pardon the delay in responding to your post. I will ask an MKL expert to assist here. Please stand-by.

0 Kudos
lu__shengliang
Beginner
290 Views

Kevin Davis (Intel) wrote:

Please pardon the delay in responding to your post. I will ask an MKL expert to assist here. Please stand-by.

 

Thanks Kevin. I've found that there is no problem. Nothing goes wrong with the code or compiler. There are 240 threads running.

However, I don't know how to set this discussion thread as <solved>. Thanks for replying anyway.

 

0 Kudos
Kevin_D_Intel
Employee
290 Views

Ok, thank you for the update/reply. We do apologize though for our lack of a reply earlier.

Not being able to mark a thread resolved/answered/etc. is something lacking with our Forums at present. There are discussions/ideas being considered for that but currently it requires posting a reply :-(

0 Kudos
lu__shengliang
Beginner
290 Views

No problem, Kevin!

Indeed, our developers need a lot of help from your side. thanks for your effort.

 

I will probably go for further questions later :)

0 Kudos
Reply