what's the good way to use GPU acceleration in matrix-based code under dealii environment

114 views
Skip to first unread message

timo Hyvärinen

unread,
Oct 2, 2023, 4:09:01 AM10/2/23
to dea...@googlegroups.com
Hi, deal community and developers,

Thank you for all the help I ever got from you guys.

I'm developing a MPI vector-valued non-linear PDEs solver. The way I chose is dumping newton iteration, which uses AMG preconditioner support from Trilinos 12.18 for linear solver. Currently, the program is CPU code. It works, and fast enough for practical purposes. 

However, as the subject suggests, I always wonder if I can take advantage of GPU to make my code faster or cheaper. The clusters I am using have Nvidia Ampere A100 and AMD MI215 gpu nodes. It will be a big waste if I don't use them.

I know dealii has CUDA wrapper and Kokkos leverage. But what I don't know is how I can *properly* use them to speed up matrix-based newton iteration code. I wonder if there is a *suggested pattern* to conduct GPU programming in dealII?  A naive idea in my mind is to use GPU for system-matrix assembly, but I didn't see this in the only cuda tutorial i.e., step-64. As there is possibly(always) an untold conversion for a legendary library. I wonder what are the suggested ways in dea.ll for using GPU in matrix-based code?

Tim,
Sincerely

Bruno Turcksin

unread,
Oct 2, 2023, 9:36:58 AM10/2/23
to deal.II User Group
Tim,

There is currently no way to do what you want. There is ongoing work to replace the Epetra wrappers with Tpetra (https://github.com/dealii/dealii/pull/16052), this will allow to use GPU in matrix-based code. You will probably get the majority of the speedup using GPU for the solver, so you could assemble the matrix on the CPU, move it to GPU, and solve the system on the GPU. Unfortunately for now, you have to do that yourself.

Best,

Bruno

timo Hyvärinen

unread,
Oct 2, 2023, 2:15:39 PM10/2/23
to dea...@googlegroups.com, Bruno Turcksin
Hi, Bruno,

Thank you for your insightful and significant reply with the PR link.

Assembly by GPU is still undergoing! This certainly is my most wished-for feature.😀

If currently the GPU is used for linear solver, then I think Kokkos leverage will be more natural for Trilinos ML library and Trilinos Vectors. Hope it isn't too much harder than compiling Trilinos with Kokkos.

Tim,
Sincerely

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c22dd877-6db1-416e-b6a4-c045242c3fddn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages