Using Open Source MagmaBlas_sgemm Api without Cublas library

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

Using Open Source MagmaBlas_sgemm Api without Cublas library

Postby anikam » Wed Mar 07, 2018 5:31 pm

Hello,
Can someone show me an example of using Open Source MagmaBlas_sgemm Api without Cublas library.

Thank You,
Abhishek Nikam
anikam
 
Posts: 12
Joined: Wed Mar 07, 2018 5:27 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby mgates3 » Wed Mar 07, 2018 7:16 pm

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
mgates3
 
Posts: 829
Joined: Fri Jan 06, 2012 2:13 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby anikam » Wed Mar 07, 2018 7:25 pm

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
anikam
 
Posts: 12
Joined: Wed Mar 07, 2018 5:27 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby mgates3 » Thu Mar 08, 2018 11:27 am

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
mgates3
 
Posts: 829
Joined: Fri Jan 06, 2012 2:13 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby anikam » Thu Mar 08, 2018 10:05 pm

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
anikam
 
Posts: 12
Joined: Wed Mar 07, 2018 5:27 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby mgates3 » Fri Mar 09, 2018 12:00 am

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
mgates3
 
Posts: 829
Joined: Fri Jan 06, 2012 2:13 pm

Re: Using Open Source MagmaBlas_sgemm Api without Cublas lib

Postby anikam » Fri Mar 09, 2018 11:20 pm

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.
anikam
 
Posts: 12
Joined: Wed Mar 07, 2018 5:27 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 1 guest