Optimize the VC-SGC MC trial loop in the NEP path#1455
Draft
dingxu2016 wants to merge 2 commits intobrucefan1983:masterfrom
Draft
Optimize the VC-SGC MC trial loop in the NEP path#1455dingxu2016 wants to merge 2 commits intobrucefan1983:masterfrom
dingxu2016 wants to merge 2 commits intobrucefan1983:masterfrom
Conversation
Evaluate before/after local energies in one dual-state pass so shared descriptor work is reused across MC trial states. Dispatch the dual kernel on L_max and use energy-only ANN evaluation to cut angular descriptor footprint without changing the acceptance rule.
Build a one-time global neighbor list at the start of each MCMD call using max(rc_radial, rc_angular) as the cutoff. Replace the per-trial O(N x N_local) all-atom scan with an O(N_local x max_neighbors) lookup from the prebuilt shell. Also keep the small-box guard aligned with the shell cutoff.
Owner
|
I am not clear about the cycle speedup, what is it? Could you provide a test input and compare the whole computation time? |
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.
Summary
This PR adds two exact GPU-side optimizations to the
VC-SGCMC trial loop in theNEPpath. Tested onRTX 4090using binary alloyVC-SGCNEP4benchmarks, the combined patch improves cycle time by about+16%to+20%over the pre-optimization baseline, with no change to theVC-SGCacceptance rule.Modification
NEPenergy evaluation into one dual-state path and dispatch the angular contribution byL_max.compute()call and reuse it when constructing local inputs, replacing the previous per-trial all-atom scan.Combined speedup vs the pre-optimization baseline:
N=4000, T=2000+19.42%N=4000, T=1500+20.29%N=4000, T=900+16.32%N=10000, T=2000, mc_trials=4000+16.42%Others
VC-SGCacceptance rule unchanged.Delta Eand accept/reject behavior over the first 128 MC trials.RTX 4090runs improved cycle time by about+6.81%to+9.33%against the same dual-state +L_maxpath without global-shell input reuse.nsysshows the main benefit comes from local-input construction, while the dual-stateNEPkernel stays broadly flat.compute()call to avoid persistent cross-call cache invalidation logic and keep the upstream patch reviewable.