Repository navigation
perf(lcao): reuse common terms across magnetic components - #8256
Merged
mohanchen merged 3 commits intoNov 2, 2026
Merged
Conversation
4 tasks done
QuantumMisaka
requested review from
ABACUS-PR-BOT,
Growl1234,
PeizeLin and
maki49
November 2, 2026 03:12
AsTonyshment
approved these changes
Nov 2, 2026
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
No confirmed correctness regression found in the inspected paths. The inline comments suggest a matrix-level regression and one project-rule cleanup.
Static review of 06ab2be77 against d20090cc: whitespace and governance checks passed. The linked baseline comparisons were inspected as author-provided evidence; no build or runtime checks were performed.
Growl1234
approved these changes
Nov 2, 2026
Resolve the CMake formatting conflict while retaining the integral reuse test target and its source list.
mohanchen
approved these changes
Nov 2, 2026
This was referenced Nov 3, 2026
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.
What's changed?
RI integral assembly repeatedly evaluates the same radial interpolation and solid harmonics for different magnetic components. Compute these common terms once per orbital pair and reuse the two-center results during three-center assembly.
The scalar interfaces remain available. Vector evaluation preserves each component's angular summation order; common-factor reuse can change FP64 rounding. Temporary arrays are local to evaluation. This changes CPU integral evaluation and introduces no persistent geometry cache or device allocation.
Performance
LCAO HSE calculations on displaced Si32 and CsPbI3 (5 atoms), using one V100, one MPI rank, four physical CPU cores/OpenMP threads and serial BLAS on SAI. Both versions use cuSOLVER diagonalization and CPU LibRI contractions. The baseline is unmodified
d20090cc137f.Ranges cover two paired runs in separate allocations on shared nodes, with reversed execution order. Ratios are calculated within each pair; SCF iteration counts match. Complete time includes process startup. The RI stage is measured by
Exx_LRI::cal_exx_ions, which includes geometry-dependent integrals and derivatives; EXX force contractions are unchanged.Unit Tests and/or Case Tests for my changes
The full CUDA executable build and integral tests passed with one and four OpenMP threads. Tests compare all magnetic components against scalar evaluation, cover origin/near-origin/cutoff behavior, and check gradients by finite differences in all three directions.
The benchmark cases, a CPU execution control, and complex-tensor Si32 on a regular 2x1x1 k mesh with two MPI ranks/GPUs all converged with matching iteration counts. Maximum differences were 1.4e-11 eV/atom, 2.0e-10 eV/Angstrom and 1.4e-9 kbar. These comparisons establish agreement with the baseline. The combined changes also passed a build and regression checks with CUDA disabled.
Inputs, timings, numerical comparisons and test logs. Benchmark executables enable identical existing timer JSON output; this instrumentation is excluded from the change.
Linked Issue
Supersedes the integral-evaluation part of #8193. This change is independent of the radial-table and Libxc optimizations and does not require #8169.
Governance Notes
No documentation update required: this changes internal LCAO integral evaluation without changing INPUT parameters, dependencies or numerical settings.