[ad-20] add external residual solver example#53
Open
krystophny wants to merge 29 commits into
Open
Conversation
Member
Author
|
Implemented AD-20 here.
Verification: focused AD-20 pytest passed ( |
d4f08fd to
55b423b
Compare
55b423b to
ee055b6
Compare
ee055b6 to
cd76d7c
Compare
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.
Adds a small external residual-solver example over fixed-boundary interior DOFs.
F(x)from the public raw residual.State.energy_gradient(exact when the build provides it, raw-force fallback otherwise) and the Newton-Krylov matvec throughState.raw_residual_jvp.Closes #21.
Verification
Test fails before
Test passes after
Enzyme-off isolated build (FD path):
Enzyme-on isolated build (exact path, fixed RZ, LLVM/Flang 22.1.6):
test_exact_hvp_does_not_count_residual_evaluationsasserts the counter contract on both paths. Full stack AD suite at this tip: 31 passed on both builds.