Change DF gradient routine full/short-range j2c inversion algorithm to CD#803
Open
henryw7 wants to merge 3 commits into
Open
Change DF gradient routine full/short-range j2c inversion algorithm to CD#803henryw7 wants to merge 3 commits into
henryw7 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.
Similar to PR #783, for a big system (
gpu4pyscf/benchmarks/molecules/organic/095_Azadirachtin.xyz) withdef2-universal-jkfitauxbasis, the smallest eigenvalue of thej2cmatrix is close to threshold (1e-7 by default), and it introduces numerical instability to gradient calculation as well. Here we noticed that the general matrix solvercp.linalg.solveis not numerically stable enough (when changing GPU type from A100 to A30, a 1e-4 error on final gradient is introduced). Surprisingly, eigenvalue solver is also not stable enough (same magnitude of error ascp.linalg.solve). Only the Cholesky solver provides a reasonable stability (1e-5 error across GPUs). This conclusion might be coincidence on the particular system, and any suggestion is welcome.This PR also fix the CD part in
gpu4pyscf/gpu4pyscf/df/grad/rhf.py
Line 32 in 3edad9f