Skip to content

Add new application: petsc-gmres - #87

Draft
william-dawson wants to merge 5 commits into
RIKEN-RCCS:developfrom
william-dawson:add-petsc-gmres
Draft

Add new application: petsc-gmres#87
william-dawson wants to merge 5 commits into
RIKEN-RCCS:developfrom
william-dawson:add-petsc-gmres

Conversation

@william-dawson

Copy link
Copy Markdown
Contributor

A PETSc KSP (GMRES + GAMG) benchmark, verified on Rikyu, Fugaku, and R-CCS Cloud's DGX Spark. [code:petsc-gmres]

We have not verified scalability with number of GPUs — the problem size (audikw_1, 943,695 rows) is likely too small to amortize GAMG's setup-communication cost across multiple GPUs.

Performance data

Rikyu (GB200 NVL4), 1-node CPU strong scaling

ranks solve_time_s
36 12.77
72 7.89
108 6.22
144 5.39

Rikyu, 2-node CPU strong scaling

ranks nodes solve_time_s
144 1 5.39
144 2 (72/node) 6.65
216 2 (108/node) 3.66
288 2 (144/node) 1.80

Rikyu, GPU (single node)

GPUs solve_time_s
1 1.55
2 5.81
4 6.04–6.07

1 GPU beats multi-GPU — this is the scalability gap noted above, not yet resolved with a larger matrix.

Fugaku (A64FX), 1-node strong scaling (48 ranks/node)

ranks solve_time_s speedup vs 1 rank
1 82.25 1.00x
2 67.10 1.23x
4 55.19 1.49x
8 45.20 1.82x
12 29.04 2.83x
24 16.56 4.97x
48 9.20 8.94x

Fugaku, multi-node strong scaling (fully packed, 48 ranks/node)

ranks nodes solve_time_s speedup vs 1 node
48 1 9.20 1.00x
96 2 5.12 1.80x
192 4 3.78 2.43x
384 8 3.04 3.03x

DGX Spark (GB10, R-CCS Cloud), single GPU

machine GPU solve_time_s
Rikyu B200 1.55
DGX Spark GB10 8.12

Correctness (relative L2 error, ~0.03–0.04) matched exactly across all of the above.

william-dawson and others added 5 commits August 5, 2026 22:48
PETSc KSP (GMRES + GAMG) benchmark: loads the audikw_1 sparse SPD matrix
(SuiteSparse GHS_psdef group, 943,695 x 943,695, 77,651,847 nnz) via
MatLoad against a pre-converted PETSc binary file, solves Ax=b for a
known x, reports relative L2 error and solve wall-time.

PETSc is fetched via bk_fetch_source, pinned to v3.25.2. The app's own
source is vendored directly in src/ rather than fetched from a separate
repo, since its upstream development happens in a private RIKEN-RCCS
repository (not fetchable by bk_fetch_source's plain git clone).

RIKYU build/run recipe validated end to end on real hardware: PETSc
builds and configures cleanly against nvhpc-hpcx, the app compiles and
links, and a 4-rank run against the staged matrix produces a correct
result (relative L2 0.03154, matching the expected ~0.03-0.04 band).
Fugaku and RC_DGXSP cases are included in build.sh/run.sh based on
previously-validated recipes on those systems, but their list.csv rows
are enable=no pending data staging (see README.md's "Staging the data"
section -- Fugaku's group-storage volumes are currently at quota).

-pc_gamg_square_graph 0 is required at any rank count above 1 on every
system, to avoid a crash in GAMG's aggressive-coarsening graph-squaring
step on this matrix's connectivity (a cuSPARSE resource error on GPU, a
multi-GB single-allocation OOM on CPU).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Validated end to end on real ng-dgx-m2 hardware (same GB10 Blackwell
hardware as the ng-dgx-m1 this app's list.csv actually targets, just
idle at the time): PETSc CUDA build (CUDA_ARCH auto-detected as 121,
matching GB10's sm_121), matrix conversion (nnz=77,651,847, correct),
and a 1-rank GPU run all succeeded -- solve_time_s=7.57,
relative L2=0.0443346 (correct, matches the known-good cross-machine
baseline).

Stages audikw_1.petscbin at a fixed path under $HOME (this system has
no separate group-storage tier, unlike RIKYU/Fugaku), flips RC_DGXSP to
enable=yes in list.csv, and drops the now-stale nvhpc-hpcx/26.3 version
pin in favor of the unversioned module name actually available here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The original ra000009 group storage attempt (/vol0002) had a 0-byte hard
quota limit -- true across every group tried (ra000009, ra250029,
hp250291), and independent of the "0k" shown by lfs quota, which turned
out to mean "unlimited" on some volumes and "hard-enforced zero" on
others. /vol0005 (also already covered by this app's FJ queue.csv
GFSCACHE declaration, alongside 0002-0004) accepted the write under
ra250029 with plenty of headroom (only 64K/4.9TB used beforehand).

Validated end to end on real hardware: a 4-rank run against the
re-staged data succeeded, solve_time_s=55.50, relative L2=0.03154 --
matches the earlier-measured 4-rank baseline exactly.

All three systems (RIKYU, Fugaku, RC_DGXSP) are now enable=yes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…er cwd [code:petsc-gmres]

Found by actually running this through BenchKit's own invocation
convention (bash programs/petsc-gmres/build.sh <system> from the repo
root) rather than continuing to trust a hand-replication of its
commands: BenchKit invokes build.sh with $PWD = repo root, not
programs/petsc-gmres/, so the bare "src/GMRES-PETSc.cpp" reference in
all three system cases never resolved -- "cannot open source file".
$PWD-relative paths elsewhere (PETSC_DIR, ARTIFACT_DIR, bk_fetch_source's
own dest) were already correct, since those are meant to live at the
repo root; only this app's own vendored source needed a different
anchor. Fixed with a BASH_SOURCE-derived APP_DIR.

Full real-pipeline validation on RIKYU after this fix: real
bk_fetch_source, real build.sh producing a working artifact, real
scripts/test_submit.sh correctly parsing list.csv/system.csv and
constructing the sbatch command, a real sbatch-launched run.sh producing
a correct FOM line, and scripts/result.sh turning it into valid Result
JSON with the real PETSc commit hash recorded. This is now confirmed
against BenchKit's actual machinery end to end, not just a hand-replica
of its commands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…:petsc-gmres]

Ran build.sh + a real pjsub-submitted run.sh from a genuinely clean
checkout (no pre-existing petsc/, artifacts/, or results/ -- explicitly
not reusing any earlier manually-built state), matching the same rigor
already applied to RIKYU. Found two more real bugs, both only visible
through the real invocation path, not by reading the script:

1. build.sh's Fugaku case had the PETSC_WITH_EXTERNAL_LIB link-flags
   string wrapped in double quotes, passing the whole multi-flag string
   as one malformed argument to the linker instead of word-splitting it
   -- PETSc itself built fine, only the final app-compile step failed.

2. run.sh's Fugaku DATA path used /vol0005, the "resolved" canonical
   path a filesystem tool reported when the data was staged -- but that
   path doesn't resolve from a real compute-node job; /vol0500 (the
   alias actually used to stage it) does. The exact same class of
   surprise as the earlier Rikyu APP_DIR bug: trust what actually runs,
   not what a tool reports as canonical.

Full pipeline now confirmed on Fugaku from a clean checkout: real
bk_fetch_source, real build.sh producing a working artifact, a real
pjsub-submitted run.sh producing a correct FOM (9.17s, matching the
already-measured 48-rank baseline), and scripts/result.sh producing
valid Result JSON with the same PETSc commit hash as RIKYU's (confirms
the pinned v3.25.2 tag resolves identically across systems).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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