Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3075 +/- ##
==========================================
+ Coverage 84.28% 84.39% +0.10%
==========================================
Files 258 260 +2
Lines 57469 58168 +699
Branches 4914 4947 +33
==========================================
+ Hits 48439 49091 +652
- Misses 8206 8256 +50
+ Partials 824 821 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mloubout
left a comment
There was a problem hiding this comment.
This doesn't look right, having to track MultiSubs seaprately looks overly complicated, and having a haloscheme having separate arguments and runtime_tkns is not right.
|
The osx failure is the Apple-silicon detection flake, not this change: the job header reads |
Under DEVITO_MPI=overlap/overlap2/full an equation over a SubDomainSet (or DevitoPRO's ABox) skipped points near the box edges: the HaloScheme only honored SubDimension thicknesses, so a MultiSubDimension's thickness was applied on top of the CORE/OWNED bounds rather than intersected with them. Honor the thicknesses of every non-local AbstractSubDimension. The overlap2 regions now describe the OWNED split of the root Dimensions only, and the remainder intersects them with the iteration bounds, as these may only be known within the Operator.
0a1835a to
ab62c88
Compare
|
Reworked: there is no MultiSub tracking and no The overlap2 region struct now holds only the OWNED regions of the root Dimensions. The remainder intersects it with the iteration bounds ( The one codegen change for regular SubDomains: under overlap2/full the struct no longer stores per-region thicknesses, and the remainder computes them instead. The new test is a minimal two-box |
Under
DEVITO_MPI=overlap,overlap2andfull, an equation over aSubDomainSet(or DevitoPRO's ABox) skips points near the box edges.basicanddiag2are correct. This is the MultiSubDomain counterpart of #1309: #1320 fixed it forSubDimensiononly.Root cause
HaloScheme.__init__only honorsd.is_Sub and not d.local(halo_scheme.py:145).MultiSubDimensionis anAbstractSubDimensionwithis_Sub=False, so its thicknesses never reachhonoredor theomapper. The thickness is then added on top of the CORE/OWNED bounds instead of being intersected with them. Generated code on main for the new test (overlap2, 4 ranks):overlap2/fullhave a second constraint. The OWNED region struct is filled in Python at argument time (MPIRegion._arg_values). For aSubDomainthe struct also carries the per-region thickness, but a MultiSubDimension thickness is only bound inside the Operator (x_ltkn0 = boxes[n0][0], or per time step for an ABox).Fix
HaloSchemehonors the thicknesses of every non-localAbstractSubDimension;AbstractSubDimension.localdefaults toFalse.ltkn -> MAX(0, x_m + ltkn - reg[i].x_m), and likewise on the right. This is the same rule forSubDimensionandMultiSubDimension, with no separate runtime bookkeeping.MPIRegionloses its non-Dimension fields.Generated code with the fix:
For a regular
SubDomainunderoverlap2/full, the region struct drops its*_tknfields and the remainder computes the same intersection itself instead of reading it from the struct.basic,diag2andoverlapcode for regular SubDomains is unchanged.Test
TestMultiSubDomain::test_subdomainset_stencil_mpi: two boxes on a 12x12 grid over 4 ranks, one step ofu.forward = u.laplace + 1. The expected result is exactly 1 inside the boxes and 0 elsewhere. It runs in all five modes. On main it fails underoverlap,overlap2andfull; with the fix it passes in all five.Checks (local, ese-ponte)
tests/test_{mpi,subdomains,dimension,operator,buffering,gpu_common,interpolation,pickle}.pyunderDEVITO_LANGUAGEC, CXX and openmp, with the MPI tests run separately without xdist:-m parallel), main-m "not parallel"), main and this PRruff check --preview, isort andpre-commit run --filesare clean.DevitoPRO with this commit pinned (devitopro#1026's ABox MPI tests included):
test_abox.py,test_subdomains.pyandtest_compressed_funcs.py::TestAdvanced::test_gradient_abox: 8 failed / 13 passed on the current pin (all ABoxforward/backward/adjoint/gradientcases under overlap2/full); 21 passed with this commit. The non-MPI cases (37) pass on both.test_gpu_lang.py::TestMPIOverlapMode(incl.test_alignment_core_and_remainder), H200: 39 passed and 2 failed with this commit, identical to the current pin. All 8test_alignment_core_and_remaindercases pass on both; the 2test_layered_domain_check[noop]failures are an nvcc build error (__cudaLaunchmacro) on both.-abox True, 4 ranks: |dvp| underfull/overlap2goes from 401.43 to 544.235, matchingbasic/diag2and within 3e-7 relative of serial.🤖 Generated with Claude Code