Repository navigation
Add selectable flat, fused and strided secondary-variable scheduling - #404
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
==========================================
+ Coverage 57.48% 58.54% +1.05%
==========================================
Files 224 224
Lines 30333 30384 +51
==========================================
+ Hits 17437 17788 +351
+ Misses 12896 12596 -300 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CPU secondary-variable updates can revisit large worker ranges for each dependent property or distribute spatially uneven property costs poorly. Add
secondary_schemetoKernelAbstractionsContext,DefaultContext, andParallelCSRContext, keeping:flatas the default::flat: retain the existing contiguous worker batches.:fused: group variables by their associated entity and evaluate dependent properties on cache tiles sized usingminbatch.:strided: incorporate Secondary variables: strided batches, up to four per thread #385's distribution of up to four interleaved batches per worker.Evaluation calls the exported
secondary_scheme(model)function, which defaults to the context setting and can be specialized by applications. Preserve the setting in adjoint/linear-solver contexts and multimodel backend adaptation. Non-default schemes require CPU host evaluation.Fused evaluation preserves dependency order within each entity and uses one worker launch per entity group. Entity groups come from the variable definitions, including domains whose generic entity enumeration omits their actual variable entities. Typed-key dispatch keeps heterogeneous state lookups specialized without per-variable tuple definitions. The production-source diff is +130/-9 lines, including documentation and the shared context plumbing. The public selector is included in the manual so the context docstring cross-references resolve.
Validation
Performance
Julia 1.13.2 on a Ryzen 7950X under WSL; 15 workers pinned to physical cores, BLAS=1, Float64/Int32, fixed GMRES/GS/KA system ILU. Norne z8 and Olympus z4 use three original report entries capped at one day each. Each policy warms separately; each measured sample starts with fresh storage/hierarchies; three rounds rotate policy order. These are short diagnostic schedules, not new first-20%-schedule scaling results.
Fused reduces the secondary phase by about 33-35%, with total median reductions of 3.06% / 1.68%. Strided gives 0.38% / 1.50% total median reductions and increases allocation. Total differences are small relative to setup/solver noise: an earlier fused-only screen gave 1.90% for Norne and -0.55% for Olympus. Both schemes remain opt-in.
The branch and measurements start from
3b90948f; the branch merges cleanly with current maindc6e630c. This PR is independent of the sorted-ILU traversal change and includes no ILU scaling or worker-policy changes.