Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRIMME and GPU support #47

Open
ngc1052 opened this issue Apr 20, 2021 · 1 comment
Open

PRIMME and GPU support #47

ngc1052 opened this issue Apr 20, 2021 · 1 comment

Comments

@ngc1052
Copy link

ngc1052 commented Apr 20, 2021

According to the documentation, GPU support is realized through the magma library. I'm not really familiar with it, but from their website it seems they put more emphasis on CUDA support, therefore NVIDIA devices only.

Is there a way around your magma interface so that I can use any GPU API for eigenvalue problems? My only goal is to use lower level instructions in my matvec (possibly OpenCL, but it's still flexible) and avoid copying to/from the GPU in every call, so PRIMME should work with my vectors on the GPU.

I'm still a newbie in GPU programming, so maybe I'm missing something here. What is the main concept behind your GPU support? The given example is specifically built around magma, at this point I don't see what is behind this choice.

@eromero-vlc
Copy link
Collaborator

PRIMME uses MAGMA internally for doing BLAS operations on GPUs. The user is only responsible to call the MAGMA initialization and to pass a handler to PRIMME. The matvec does not need to use MAGMA. The matvec just receives the pointers to the input and output vectors, that for GPUs, they are pointing to device (GPU) memory allocations.

Currently, PRIMME only supports CUDA devices (NVIDIA gpus). And, in the following months, we are going to support AMD gpus with HIP.

HIP is an open source CUDA compatible interface that can target NVIDIA and AMD gpus. See https://rocmdocs.amd.com/en/latest/Programming_Guides/HIP-FAQ.html. And, HIP code may be able to run on OpenCL compatible devices such as intel gpus. See https://github.com/cpc/hipcl.

If you don't have experience in writing GPU code, I will suggest to try to use a library that makes the heavy lifting for you. In this sense, MAGMA have handy functions for manipulating dense matrices and have some support for sparse matrices. Look also cuSPARSE and hipSPARSE.

If you send us the code for the matvec, we can take a quick look and make more informative suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants