HPCG solves a 3D Poisson problem with a preconditioned conjugate gradient method and stresses memory bandwidth and interconnect rather than peak FLOPs. I started from an existing single-GPU implementation that stores the 27-point stencil matrix in the DIA format and parallelises symmetric Gauss-Seidel (SymGS) with box colouring, and ported it to multiple GPUs and nodes. The first port was slower than the original even on a single GPU: the ghost cells needed for the halo exchange broke coalesced memory access. Step by step I reworked indexing and data layout until the multi-GPU code, run on one GPU, was faster than the single-GPU code it came from: 1.50× for SpMV and 1.78× for SymGS. Then I scaled it out to 512 nodes and 2,048 GH200 GPUs on ALPS.
The structured 3D grid behind HPCG’s 27-point stencil (8 × 8 × 8 points).
From the naive port to faster-than-the-original: every step measured on one GH200 (256³ grid, multi-GPU code path) against the single-GPU code.Weak scaling with 32³ points per GPU (median of 10 runs). The time per iteration grows while processes gain halo neighbours, then stays flat once most have all 26. Hover a point for details.
Sweep 1 of 9
Hover a point: its 9-point stencil covers 9 different colours, so all points of one colour can be updated in the same sweep.
Box colouring makes symmetric Gauss-Seidel parallel. Shown in 2D with a 9-point stencil and 9 colours; HPCG’s 27-point stencil in 3D needs 27.
My contribution
Ported the DIA-based single-GPU HPCG to multiple GPUs and nodes: SpMV, SymGS, multigrid, CG, dot products and WAXPBY.
Halo exchange over a 3D domain decomposition with up to 26 neighbours, using MPI (host and CUDA-aware) and NCCL.
SpMV: locality-optimised indexing and column-major DIA storage, so consecutive threads read consecutive memory (84.6% memory utilisation efficiency).
SymGS: colour-wise storage, so all coefficients of one box colour are contiguous and no colour offsets are computed at run time (92.0% memory utilisation efficiency).
Results
On one GH200, the multi-GPU code beats the original single-GPU code: 1.50× faster SpMV and 1.78× faster SymGS (from 0.32× and 0.68× after the naive port).
Verified on up to 512 nodes, 2,048 NVIDIA GH200 GPUs, on the ALPS supercomputer.
Ported to the AMD cluster Beverin.
Lesson: a data layout that is best for one kernel can be the worst for another; colour-wise storage speeds up SymGS but slows SpMV to 0.72×.