On Wed, Nov 18, 2026 at 12:27 PM Juan Sebastián Hincapié Montes via
petsc-users <[email protected]> wrote:

> Dear PETSc developers,
>
> We are porting our finite element code FEMuSS to LUMI-G (AMD MI250X,
> gfx90a) using PETSc 3.24.4 built with HIP and Kokkos (cpeCray 25.03, ROCm
> 6.3.4). Our test case is a 2D Poisson-type problem (heat equation, linear
> triangles), 6.56M unknowns, 45.9M nonzeros, solved with CG + GAMG on 1 GCD:
>
> # Krylov solver: CG (Poisson is symmetric positive definite)
> -ksp_type cg
> -ksp_rtol 1e-8
>
> # Preconditioner: algebraic multigrid (GAMG), smoothed aggregation
> -pc_type gamg
> -pc_gamg_type agg
> -pc_gamg_agg_nsmooths 1
> -pc_gamg_threshold 0.01
>
> # Smoother on each level: Chebyshev + Jacobi (same as the GPU case)
> -mg_levels_ksp_type chebyshev
> -mg_levels_pc_type jacobi
> -mg_levels_ksp_max_it 2
>
> # Matrix on the CPU
> -mat_type aij
>
> The solve phase works very well on the GPU (KSPSolve 0.31 s, 11
> iterations, GPU %F = 100), but the setup dominates and seems to run mostly
> on the CPU:
>
> With -mat_type aijhipsparse (PCSetUp 6.41 s):
> - PCGAMGCreateG 2.21 s (MatCreateGraph 1.16 s)
> - GAMG Coarsen 2.07 s (MIS/Agg 0.85 s, Squ l00 0.15 s)
> - PCGAMGProl 1.13 s (Prol-lift 1.10 s, 0 flops)
> - PCGAMGOptProl 0.65 s
> - PCGAMGCreateL 0.30 s
> - MatTranspose: 15 calls, 0.72 s, 0 flops
> Total Mflop/s / GPU Mflop/s for PCSetUp = 967 / 22791, i.e. the GPU is
> busy roughly 4% of the setup time, although GPU %F is 97%.
>
> With -mat_type aijkokkos (PCSetUp 17.6 s, same hierarchy and iterations):
> - PCGAMGCreateG 9.45 s, of which MatCreateGraph is only 0.98 s
> - GAMG Coarsen 5.64 s, of which MIS/Agg is 0.93 s and Squ l00 0.18 s
> So about 13 s of the setup is not covered by any sub-event.
>
> For reference, the same setup on 16 CPU cores takes 3.5 s.
>
> Our questions:
> 1. With aijkokkos, what could explain the ~8.5 s in PCGAMGCreateG outside
> MatCreateGraph and the ~4.5 s in GAMG Coarsen outside MIS/Agg? Is there a
> host conversion or rebuild of the graph that is not logged?
> 2. We understand that a GPU MIS coarsener (MATCOARSENMISKOKKOS) is in
> development. Is there a branch or merge request we could test, and is it
> planned for an upcoming release?
> 3. In the meantime, are there options you would recommend to reduce the
> host-side setup cost on GPUs (for example regarding aggressive coarsening,
> the coarsener type, or the threshold)? For transient runs we also plan to
> reuse the preconditioner across time steps.
>
>
Hi Juan,

We focused on getting the hot solves on GPUs in PETSc.
With a Newton solver that is the coarse grid operator construction and the
actual solve, not the graph setup you are looking at.
The graph setup is not on the GPU in PETSc but I have a fork that puts the
graph setup, and a lot of other stuff in Kokkos described here:
https://urldefense.us/v3/__https://arxiv.org/abs/2606.24748__;!!G_uCfscf7eWS!Zhc9EEY8MQ0jAwJm4ApEvbOZz1cJUR-wtvIlJBO82FmFhO0s1AMsC8-2XV56uRaKiFNHHqaWey9ZD1YlhxtFSp4$
 .

The paper includes reproducibility instructions that detail how to obtain
the code (a patch file).
The patch is about 40K LOC. The GAMG part is a few thousand LOC.
You can go straight to the repo:
https://urldefense.us/v3/__https://gitlab.com/markadams4/petsc-claude-papers/-/tree/main/baijkokkos__;!!G_uCfscf7eWS!Zhc9EEY8MQ0jAwJm4ApEvbOZz1cJUR-wtvIlJBO82FmFhO0s1AMsC8-2XV56uRaKiFNHHqaWey9ZD1YlM_M4wVY$
 

Hope this helps,
Mark



> The complete -log_view outputs (with -log_view_gpu_time and -ksp_view) for
> both matrix types are attached.
>
> Thank you for your time and for PETSc.
>
> Best regards,
> Juan Sebastián Hincapié
> CIMNE
>

Reply via email to