Skip to content

ci: use GPU-aware MPI halos on GPU test runs (opt-out input) - #87

Merged
cenamiller merged 4 commits into
masterfrom
ci-gpu-aware-halos
Oct 16, 2026
Merged

cenamiller merged 4 commits into
masterfrom
ci-gpu-aware-halos

Conversation

@cenamiller

Copy link
Copy Markdown
Collaborator

MPAS host-stages every halo exchange (acc update self/device around the exchange) unless config_gpu_aware_mpi = .true. is set in &development, so the GPU CI runs spend most of their time stepping on host<->device copies.

Add a gpu-aware-mpi input (default false) to the run-mpas and run-perturb-mpas actions. When true it sets config_gpu_aware_mpi in the namelist (creating &development if missing, idempotent) and the MPI library's GPU-support environment (MPICH_GPU_SUPPORT_ENABLED=1, or the OpenMPI UCX/CUDA settings), via two small shared scripts.

The GPU test workflows (_test-gpu ECT members, _test-bfb and _test-perf GPU legs) get a gpu-aware-mpi workflow input defaulting to true, so GPU runs use device-resident halos; CPU legs are unchanged. Set it to false to fall back to host-staged halos, e.g. if a container's MPI lacks CUDA support (MPI then aborts rather than silently staging).

On Derecho (Cray MPICH) the namelist change alone gives bit-identical output at 30km on 4 GPUs and 2.2-2.7x faster time stepping.

MPAS host-stages every halo exchange (acc update self/device around the
exchange) unless config_gpu_aware_mpi = .true. is set in &development, so
the GPU CI runs spend most of their time stepping on host<->device copies.

Add a gpu-aware-mpi input (default false) to the run-mpas and
run-perturb-mpas actions. When true it sets config_gpu_aware_mpi in the
namelist (creating &development if missing, idempotent) and the MPI
library's GPU-support environment (MPICH_GPU_SUPPORT_ENABLED=1, or the
OpenMPI UCX/CUDA settings), via two small shared scripts.

The GPU test workflows (_test-gpu ECT members, _test-bfb and _test-perf
GPU legs) get a gpu-aware-mpi workflow input defaulting to true, so GPU
runs use device-resident halos; CPU legs are unchanged. Set it to false to
fall back to host-staged halos, e.g. if a container's MPI lacks CUDA
support (MPI then aborts rather than silently staging).

On Derecho (Cray MPICH) the namelist change alone gives bit-identical
output at 30km on 4 GPUs and 2.2-2.7x faster time stepping.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Namelist editing can silently fail to enable GPU-aware MPI, and dispatch workflows do not expose the fallback input.

2 open findings
What changed in this PR

Enables GPU-aware MPI halo exchanges in GPU CI runs to reduce host–device transfers while leaving CPU legs unchanged.

Changes:

  • Adds optional GPU-aware MPI inputs to both run actions.
  • Introduces shared namelist and MPI environment helpers.
  • Defaults GPU test workflows to GPU-aware MPI.
File Description
.github/​workflows/​_test-perf.yml Enables GPU-aware MPI for GPU performance legs.
.github/​workflows/​_test-gpu.yml Passes the setting to GPU ensemble runs.
.github/​workflows/​_test-bfb.yml Enables the setting for GPU comparison variants.
.github/​scripts/​gpu-aware-mpi-env.sh Configures MPI GPU-support settings.
.github/​scripts/​enable-gpu-aware-mpi.sh Enables GPU-aware MPI in the namelist.
.github/​actions/​run-perturb-mpas/​action.yml Applies configuration to ensemble members.
.github/​actions/​run-mpas/​action.yml Adds optional GPU-aware MPI configuration.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/scripts/enable-gpu-aware-mpi.sh Resolved
Comment on lines +31 to +35
gpu-aware-mpi:
description: 'Use GPU-aware MPI halo exchanges on the GPU (OpenACC) runs (config_gpu_aware_mpi + MPI GPU-support env). Needs CUDA-enabled MPI in the container; set false to fall back to host-staged halos.'
required: false
type: boolean
default: true
cenamiller and others added 3 commits October 16, 2026 11:28
…les comments and case-sensitive groups'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The opt-out only existed on the reusable workflows (_test-gpu, _test-bfb,
_test-perf), so a dispatched GPU run always got the new default (true) and
could not select host-staged halos when a container's MPI lacks CUDA
support. Add a boolean gpu_aware_mpi dispatch input (default true) to
perf-cpu-vs-gpu, bfb-decomp-gpu, bfb-io-gpu, bfb-nvhpc-cpu-vs-gpu,
test-gpu-mpich and test-gpu-openmpi and forward it as gpu-aware-mpi.
test-cross-repo has its GPU job commented out and is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The check-gpu-aware-mpi workflow showed that the CI OpenMPI GPU container
(OpenMPI 5.0.9 --with-cuda: accelerator:cuda + btl:smcuda) has no ucx pml/osc
component, so forcing --mca pml ucx / OMPI_MCA_pml=ucx aborts MPI_Init
("Framework: pml, Component: ucx not found"). That would have broken every
OpenMPI GPU job now that GPU-aware halos are the default. OpenMPI is CUDA-aware
on a node by default in that image (the default environment passes a device
buffer exchange), so set nothing for it.

For MPICH (4.3.2, ch4:ucx, --with-cuda) set MPIR_CVAR_ENABLE_GPU=1, the stock
MPICH variable, in addition to the Cray MPICH one; both passed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cenamiller
cenamiller merged commit 490d39c into master Oct 16, 2026
36 checks passed
@cenamiller
cenamiller deleted the ci-gpu-aware-halos branch October 16, 2026 21:40
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.

2 participants