Repository navigation
Conversation
maki49
force-pushed
the
symfilter_refactor
branch
from
November 10, 2026 09:19
d31699a to
2ed47de
Compare
maki49
force-pushed
the
symfilter_refactor
branch
from
November 10, 2026 09:41
2ed47de to
ab77f0b
Compare
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.
GPU contractions use different atom-loop orders from CPU contractions. This keeps a separate GPU symmetry policy and passes every callback its enclosing-loop order, while screening the same final output atom pair and relative cell.
Filter selection now happens once before each backend's OpenMP/atom loops.
LRI::filter_atomis an optional callable returningconst Filter_Atom*; LRI has no symmetry-specific state, concrete policy includes, casts or allocation rules. Inner loops call the selected filter directly.Filter_Atomand has no forwardingfilter_for*methods.Exx/GW/RPA::set_symmetryconstructs a wrapper containing CPU and (in GPU builds) GPU policies. Repeated contractions select those existing objects. An empty selector disables filtering.set_symmetryupdates configuration.LRI_Cal_Moderemains in its original location inLRI.h, and inner callbacks retain pointer/->access. Both CPU modes select the CPU policy. Direct backend calls select their own mode before entering loops, independently of the publiccal_modefield.Filter_Atom_Symmetryto its pre-Fix real-space symmetry filtering in GPU contractions #16 form; retainFilter_Atom_Symmetry_GPUand the validated GPU callback argument order. Keep the original accumulation tests enabled.Validation (latest callable-wrapper implementation):
0:0; 456 checks per thread count, including 152 GPU checksset_symmetrytemplate compilationGPU job:
3993469, df1, V100 16GB. Logs and matching header/test hashes:~/work/lr-grad/filter-wrapper-pointer-20261110/validation-3993469.tar.gz. No additional ABACUS runs are required for this wrapper-only change; the material results previously recorded for the earlier implementation are not claimed as validation of this revision.GPU symmetry callback contract
Arguments follow the enclosing loops from outermost to innermost.
filter_for31always returns false (intermediate construction);
filter_for32rejects onlyoutput pairs outside the sector. Bold argument tuples changed in this refactor.
filter_for31argumentsfilter_for32argumentsfilter_for32a0b0_a1b1a01b01_a01b01(Aa01, Ab01, Ab2)(Aa01, Aa2, Ab2)(Aa2, Ab2)a0b1_a1b0a01b01_a01b01(Aa01, Ab01, Ab2)(Aa01, Aa2, Ab2)(Aa2, Ab2)a0b0_a1b2a01b01_a01b2(Ab01, Ab2, Aa01)(Aa01, Ab01, Aa2)(Aa2, Ab01)a0b1_a1b2a01b01_a01b2(Ab01, Ab2, Aa01)(Aa01, Ab01, Aa2)(Aa2, Ab01)a0b2_a1b0a01b01_a01b2(Ab01, Ab2, Aa01)(Aa01, Ab01, Aa2)(Aa2, Ab01)a0b2_a1b1a01b01_a01b2(Ab01, Ab2, Aa01)(Aa01, Ab01, Aa2)(Aa2, Ab01)a0b0_a2b1a01b01_a2b01(Aa01, Aa2, Ab01)(Aa01, Ab01, Ab2)(Aa01, Ab2)a0b1_a2b0a01b01_a2b01(Aa01, Aa2, Ab01)(Aa01, Ab01, Ab2)(Aa01, Ab2)a1b0_a2b1a01b01_a2b01(Aa01, Aa2, Ab01)(Aa01, Ab01, Ab2)(Aa01, Ab2)a1b1_a2b0a01b01_a2b01(Aa01, Aa2, Ab01)(Aa01, Ab01, Ab2)(Aa01, Ab2)a0b0_a2b2a01b01_a2b2(Aa01, Aa2, Ab2)(Aa01, Ab01, Ab2)(Aa01, Ab01)a0b1_a2b2a01b01_a2b2(Aa01, Aa2, Ab2)(Aa01, Ab01, Ab2)(Aa01, Ab01)a1b0_a2b2a01b01_a2b2(Aa01, Aa2, Ab2)(Aa01, Ab01, Ab2)(Aa01, Ab01)a1b1_a2b2a01b01_a2b2(Aa01, Aa2, Ab2)(Aa01, Ab01, Ab2)(Aa01, Ab01)a1b2_a2b1a01b2_a2b01(Ab01, Ab2, Aa01)(Aa01, Aa2, Ab01)(Aa01, Ab01)a0b2_a2b0a01b2_a2b01(Ab01, Ab2, Aa01)(Aa01, Aa2, Ab01)(Aa01, Ab01)a0b2_a2b1a01b2_a2b01(Ab01, Ab2, Aa01)(Aa01, Aa2, Ab01)(Aa01, Ab01)a1b2_a2b0a01b2_a2b01(Ab01, Ab2, Aa01)(Aa01, Aa2, Ab01)(Aa01, Ab01)filter_for1(Aa01)is a no-op for the first two families (Aa01 is intermediate),and checks left-output membership for the other three.
filter_for1(Ab01)checksright-output membership wherever it occurs. All
filter_for2calls are no-opsexcept the final
(Aa01, Ab01)stage ofa01b2_a2b01, which checks that outputpair. In that family's second stage, the former inner
filter_for2(Aa01, Ab01)check is absorbed intofilter_for32(Aa01, Aa2, Ab01);Aa2remains an unrestricted summation atom.For two cell-bearing output atoms the relative cell is
(Rb - Ra) % period;with
Aa01at the origin it isRb % period. An empty sector retains the existingunrestricted behavior. The numerical regression also disables symmetry on a copied selector after each
filtered run to verify independent configuration of copied LRI objects.