Repository navigation
IBM: transfer only patch_ib(1:num_ibs) in the ownership handoff - #2353
Conversation
|
Claude Code Review Head SHA: 82182ed Files changed:
Findings: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2353 +/- ##
=======================================
Coverage 65.69% 65.69%
=======================================
Files 111 111
Lines 30333 30333
Branches 4631 4629 -2
=======================================
Hits 19927 19927
Misses 6682 6682
Partials 3724 3724 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Independent NVIDIA verification of current
Rows for the ownership handoff (#2353, and #2331/#2335 neighborhood/periodic-wrap fixes), all PASS on one and two GPUs:
There is no dedicated test for the #2331 duplicate-patch case; none of the above fails. 118/118 IBM-label tests pass. Not run: chemistry tests, OpenMP-offload build, CPU build, any NVHPC other than 25.5, before/after timing of the changes. AI-assisted (Claude Code). |
Contribution Policy
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Summary
s_handoff_ib_ownershipruns every step whenever a body moves, and on more than one rank it copies the wholepatch_ibarray between host and device three times:GPU_UPDATE(host='[patch_ib]')before the compaction, andGPU_UPDATE(device='[patch_ib, num_ibs]')after the compaction and after the neighbor unpack.patch_ibhasnum_ib_patches_max_namelist= 810000 entries of roughly 1 kB, so these are several GB of transfers per step whatever the number of bodies. Only entries1:num_ibsare ever read (s_get_neighborhood_idxand every loop are bounded bynum_ibs), so the three updates now namepatch_ib(1:num_ibs). Three lines, no behavior change.Evidence
Periodic 2D box of free circles (
moving_ibm = 2, 4 cells per diameter, 12.5 % area fraction), MI250X, Cray compiler, OpenACC, one GCD per rank. Wall time per step, mean over steps 5 to 30 (steps 5 to 15 at 1e5), before and after this change. Both builds also carry #2335 and #2340, which this case needs to run at all.Attribution (timers around the call sites, not committed): of the 111 ms step, the wrap plus handoff takes 90 ms at 2 ranks and 92 ms at 8 ranks, and 0.02 ms at 1 rank (where the handoff does not run); the RHS takes 6 to 8 ms, of which the halo exchange is 2 ms. The same case with fixed bodies (
moving_ibm = 0) takes 12 ms at 2 ranks, with no bodies 7 ms, and with moving bodies on 2 nodes 96 ms, so the cost is in this path and not in MPI or GPU staging in general.Correctness: six free spinning circles on and across the seams of a 2x2 split, 100 steps, 4 ranks: the force and torque history agrees with the build before this change to 1e-14 (GPU atomics are not bitwise reproducible, so the files are not byte-identical).
Tests
./mfc.sh precheckpasses. Not run: the full test suite and other compilers or CPU builds (host and device share memory there, so the ranges change nothing but the amount copied).Limitations
The remaining per-step work in the handoff is still proportional to
num_ibs(the bodies a rank holds). I did not look at whether the three updates are needed every step at all.This PR was made with Claude Code (AI).