Fix Hermitian upper-triangle handling in native ELPA and cuSolver - #7923
Open
MagTheoryLab wants to merge 7 commits into
Open
Fix Hermitian upper-triangle handling in native ELPA and cuSolver#7923MagTheoryLab wants to merge 7 commits into
MagTheoryLab wants to merge 7 commits into
Conversation
Project multi-k density matrices before star restoration to preserve the symmetry assumed by reduced EXX contractions. Add complex-density and spin-channel regressions and update the Si HSE reference after independent solver and full-contraction checks.
dyzheng
approved these changes
Sep 8, 2026
mohanchen
reviewed
Sep 8, 2026
mohanchen
left a comment
Collaborator
There was a problem hiding this comment.
I will handle this PR later.
7 tasks
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.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Related to #7914. This PR addresses the same authoritative-upper-triangle matrix contract in the separate native
elpaandcusolverimplementations, so no separate issue is required.Dependency and attribution: the current branch also includes the two
genelpacommits from #7914 (e27ef6629938d04ea1649d4779ad13a3931bc6eband53208bf2713db64359315d3f0359adfefbbb4a38). Their original author, TaoXia, author dates, and cherry-pick source trailers are preserved. The Pauli/y change from #7914 is not included. These imported changes belong to #7914; this branch should be rebased after that PR merges so they are not reviewed or merged twice. The native ELPA/cuSolver fixes and the LAPACK test-workspace correction are authored by Chen Chengbing.Unit Tests and/or Case Tests for my changes
Reproduction: preserve the authoritative upper triangles and deliberately overwrite lower-triangle entries. Compare eigenvalues against LAPACK using an independent, unchanged fixture. For the before/after controls, link the same regression tests with either the previous solver object from develop (
fb9ce1da4) or the corrected solver object; other objects within each comparison remain unchanged.Result summary:
Corrected native ELPA also passed all three tests with four MPI ranks. Its tests check eigenvalues to
1e-10and verify that caller-owned H/S buffers remain unchanged across two consecutive solves. After importing thegenelpacommits, native ELPA again passed 3/3 on one rank and 3/3 on four ranks, and the cuSolver group passed 6/6. The importedgenelpaupper-triangle regression passed on one rank.Commands run:
SOURCE_DIRdenotes the source snapshot,BUILD_DIRthe configured CUDA build, andNEGATIVE_BUILD_DIRthe separate directory containing the old-solver control executables.The build succeeded and reported ABACUS
v3.11.0-beta9. Positive filtered tests returned 0; both negative-control executables returned the expected GTest failure status 1. Environment: Tesla V100-SXM2-32GB, GNU C++, CUDA 12.9.1, OpenMPI 5.0.10, ELPA 2026.02.001, and LibXC 7.0.0.Additional checks and limitations:
git diff --checkpassed. Governance checks reported no errors; documentation/test-evidence warnings are addressed by this body.MODULE_HSOLVER_LCAOgroup and the importedgenelparegression on four MPI ranks were attempted but hit an ELPA two-stage CPU-path failure. An independent program containing no ABACUS objects reproduced the failure. Crash addresses map to CUDA-aware MPI branches passing uninitialized device-buffer pointers during CPU execution. A diagnostic one-stage variant passed the full group on one rank (10/10) and four ranks (9 passed, 1 existing LAPACK test skipped). This variant is not part of the PR; the installed library has not been repaired.4.5907e-5,1.7279e-5, and1.7026e-5, abovescf_thr=1e-6. This PR establishes the matrix-contract correction; it does not claim to resolve that remaining SCF issue.What's changed?
LCAO supplies authoritative upper triangles for Hermitian H/S matrices. Previously, native ELPA could consume stale lower entries from the original full complex buffers, while cuSolver explicitly selected the lower triangle. Consequently, otherwise valid upper-triangle inputs could produce incorrect eigenvalues.
lwork.genelpafixes as the dependency described above.No
gga_gradfunctionality or GPU performance refactor is included.Governance Notes
genelpatransform, and colocated test helpers. ESolver, ElecState, Hamilt, Operator, and Psi interfaces are unchanged. The real native ELPA decomposition-reuse behavior is unchanged.