Page 1 of 1

Using Open Source MagmaBlas_sgemm Api without Cublas library

Posted: Wed Mar 07, 2018 5:31 pm
by anikam
Hello,
Can someone show me an example of using Open Source MagmaBlas_sgemm Api without Cublas library.

Thank You,
Abhishek Nikam

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Wed Mar 07, 2018 7:16 pm
by mgates3
The magmablas_sgemm itself only needs CUDA, not cuBLAS. Its code is in magma/magmablas/sgemm_fermi.cu and files included from there.

However, the rest of MAGMA requires cuBLAS, and we generally assume that it is available. The cuBLAS gemm, while originally derived from the MAGMA gemm, has been substantially optimized and is much faster.

-mark

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Wed Mar 07, 2018 7:25 pm
by anikam
Hello Mark,

Thanks a lot for the help, even though the performance of Magma gemm would not be as good as Cublas Gemm, the functionality of both of them
i.e the output after giving the same input to both the functions would be same, right?
Also are there 2 functions for sgemm in Magma,right?
Magmablas_sgemm- Does not require Cublas
Magema_sgemm- Requires Cublas
I request you to help me.

Thank You,
Abhishek Nikam

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Thu Mar 08, 2018 11:27 am
by mgates3
Correct that magmablas_sgemm does not require cuBLAS, magma_sgemm is a wrapper around cublasSgemm.

Up to rounding errors, the output should be the same from all gemm routines, in any BLAS library on both CPU and GPU. Since the order of reductions may differ between different implementations, do not expect exactly the same answer, bitwise.

-mark

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Thu Mar 08, 2018 10:05 pm
by anikam
Thanks a lot Mark.
Can you please help me with a couple of questions.
1)I want to just use Cuda, I dont want to use any MKL,ATLAS,ACML library, so I am supposed to set only the Cuda path in bashrc and make.inc file,right?
2)Do you have a code example on using magmablas_gemm?

Thanks a lot, Mark

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Fri Mar 09, 2018 12:00 am
by mgates3
See testing/testing_sgemm.cpp.
I've never tried linking any piece of MAGMA without cuBLAS and a host BLAS/LAPACK, so can't say what will be involved. If it's just the need for open source, use OpenBLAS.
-mark

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Posted: Fri Mar 09, 2018 11:20 pm
by anikam
Hello Mark,
Thanks a lot for helping me so far, you have been very helpful.
I am having problems making a make.inc file, basically I just need Cuda.
Can you guide me on how should I create make.inc file, I am not able to get what flags I should add.
I am using cuda 7.5, I just gave cuda path to make.inc and did a make, most of the files got sucessfully compiled, I got an error in a testing code.

Can you please help me with it.