Adaptive Convergence Optimization for Eigenvalue Iterative Solvers (CG & David)#7523
Open
tanrt123-tech wants to merge 3 commits into
Open
Adaptive Convergence Optimization for Eigenvalue Iterative Solvers (CG & David)#7523tanrt123-tech wants to merge 3 commits into
tanrt123-tech wants to merge 3 commits into
Conversation
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 improves the convergence robustness and preconditioning behavior of the iterative eigensolvers in
source/source_hsolver, mainly targetingDiagoCGandDiagoDavid.The main changes are:
DiagoCG.DiagoDavid.Motivation
The existing CG and Davidson eigensolvers can be sensitive to poor initial guesses, near-degenerate eigenvalues, or less effective preconditioning.
In
DiagoCG, the Polak-Ribiere coefficient may become negative or excessively large, which can produce unstable search directions and slow convergence.In
DiagoDavid, the previous preconditioner used a fixed diagonal denominator and did not account for the current Ritz value. This limits its ability to adapt to different spectral regions.Implementation Details
For
DiagoCG, this PR adds adaptive CG controls:The CG update now applies PR+ protection:
For
DiagoDavid, this PR introduces:The default preconditioner is now
ShiftedDiagonal, using the current Ritz value to build a safer and more adaptive denominator:where:
This PR also adds adaptive Davidson refresh logic. When the subspace is close to full and many bands are still unconverged, the solver refreshes the subspace earlier to avoid unnecessary growth of the projected eigenproblem.
Tests
Configured and built with MPI:
cmake -S . -B /tmp/abacus-diago-mpi-build \ -DCMAKE_CXX_COMPILER=mpicxx \ -DBUILD_TESTING=ON \ -DENABLE_MPI=ON \ -DENABLE_LCAO=OFF \ -DUSE_ELPA=OFF \ -DGIT_SUBMODULE=OFFBuilt relevant test targets:
cmake --build /tmp/abacus-diago-mpi-build \ --target MODULE_HSOLVER_cg MODULE_HSOLVER_dav \ MODULE_HSOLVER_cg_float MODULE_HSOLVER_dav_float \ -j2Ran single-process tests:
ctest --test-dir /tmp/abacus-diago-mpi-build \ -R "^MODULE_HSOLVER_(cg|dav|cg_float|dav_float)$" \ --output-on-failureResult:
Ran parallel tests:
ctest --test-dir /tmp/abacus-diago-mpi-build \ -R "^MODULE_HSOLVER_(cg_parallel|dav_parallel)$" \ --output-on-failureResult:
Also checked patch formatting:
Result: passed.