Skip to content

GPU stack 1/8: update feectools (device ghost exchange, single-reduction PCG); pcg_sr solver option - #782

Open
max-models wants to merge 6 commits into
develfrom
gpu-stack-1-feectools
Open

max-models wants to merge 6 commits into
develfrom
gpu-stack-1-feectools

Conversation

@max-models

@max-models max-models commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Part 1 of 8 of the split of #772 (cuda-aware-mpi-fixes) into stacked PRs. Requires struphy-hub/feectools#104 to be merged into feectools devel-tiny first (PR 1 bumps the submodule).

Merge struphy-hub/feectools#104 (feectools fix-cuda-aware-mpi-issues into devel-tiny) first. This PR points the feectools submodule at that branch (commit 1d8d47c).

  • Submodule update: device ghost-exchange plans, fused block exchanges, PConjugateGradientSingleReduction, faster stencil_dot_3d on the GPU (details in the feectools PR).
  • pcg_sr is accepted wherever pcg is (LiteralOptions.OptsSymmSolver), also with a preconditioner: Poisson, ImplicitDiffusion, GyrokineticPoissonSolve, CurlCurlSolve, VariationalDensityEvolve, VariationalMomentumAdvection. Same iterates as pcg, one global reduction per iteration instead of two.

Tests

Local, macOS without a GPU, in a fresh environment with feectools 1d8d47c and the pinned cunumpy, after merging devel (with #774 and #775). The PR passes test_cuda_parity, test_cuda_emulation, test_kernel_backends, test_sorting, test_accum_matrix_cupy, test_preconditioner_cupy, test_poisson and test_output on its own. The top of the stack also passes the mass-matrix, preconditioner, Derham-GPU, fused-gradient, Kronecker-block, Poisson, shear Alfvén, post-processing, polar fake-CuPy and all pic tests (1477 passed), the examples test for the two profiling cases, the sorting, Poisson and fused-gradient tests under mpirun -n 2, and the device MPI sort on the fake CuPy on 2 and 4 ranks. The Kronecker products match the stencil mass matrices to 5e-16 for M0, M1, M2, M3, Mv, M1n and M2n on a Cuboid, periodic and Dirichlet, on 1 and 2 ranks.
Not tested on a GPU here. The CUDA kernels and the device paths need a run on the cluster.

Stack (merge in order)

  1. Device ghost-exchange plans, fused block exchanges, single-reduction PCG (CUDA-aware MPI) feectools#104 (feectools, into devel-tiny)
# PR base
1 #782 update feectools (device ghost exchange, single-reduction PCG); pcg_sr solver option (this PR) devel
2 #783 host/device conversions in post-processing; math.sqrt in Species #782
3 #784 CUDA mass-matrix assembly kernel kernel_3d_mat #783
4 #785 apply separable mass matrices as Kronecker products of 1D banded matrices #784
5 #786 Poisson/diffusion solve with fewer passes over the vectors #785
6 #787 marker rows prepared inside the push kernels #786
7 #788 chunked marker loading, row-based weight update, leaner MPI sorting; static field in PushVxB #787
8 #789 profiling cases Poisson cube and Vlasov slab (CPU node vs GPU, GPU scaling) #788

🤖 Generated with Claude Code

… add the pcg_sr solver option

feectools: struphy-hub/feectools#104 (fix-cuda-aware-mpi-issues into devel-tiny).
pcg_sr (PConjugateGradientSingleReduction) is accepted wherever pcg is, including the
preconditioned solvers of the Poisson, diffusion, curl-curl and variational propagators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
max-models and others added 5 commits October 16, 2026 12:51
feectools b70cb6c (struphy-hub/feectools#104): the emulated GPU tests (fake CuPy) failed at the
first stencil product.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feectools 1d8d47c (struphy-hub/feectools#104).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shear Alfven solves

ShearAlfven and ShearAlfvenCurlCurl (#778, #780) accepted these preconditioners only with
solver='pcg'; pcg_sr takes a preconditioner as well, as in the other propagators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant