[ad-18] add production Enzyme energy HVP#52
Open
krystophny wants to merge 27 commits into
Open
Conversation
Member
Author
|
Implemented the AD-18 validation slice here: the low-resolution AD fixture now computes an Enzyme forward-over-reverse HVP and checks the residual sign contract on interior DOFs against centered raw-force differences. Verification: Enzyme CTest surface is 9/9 passing, including |
a561d3e to
c7ff715
Compare
c7ff715 to
8825058
Compare
eb3c73e to
07668ed
Compare
07668ed to
9ef05f0
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.
Summary
gvec_mhd3d_flat_energy_hvp) from the fixed-map kernel with__enzyme_fwddiffover the reverse-mode gradient.MODgvec_py_state_adand exposeeval_energy_hvp_enzymewith size and context status checks.State.energy_hessian_vector_product(q, v, method=...)andState.raw_residual_jvp(q, v, method=...)with the sign contractraw_residual_jvp == -energy_hvp;State.hessian_vector_product(v)stays as the current-state residual-JVP compatibility API.gvec_enzyme_production_operators, register it as CTestgvec_enzyme_hvp, and extend it with an HVP check against a centered finite difference of the raw projected force; no duplicate executable run.UnsupportedFeatureErrorfor exact requests.Closes #19.
Verification
Toolchain: LLVM/Flang 22.1.6, Enzyme
LLVMEnzyme-22.sobuilt from commitc9650834.Before (b678d3a)
No production HVP symbol and no production HVP test:
After (8825058)
Fresh fixed-RZ and fixed-cyl Flang/Enzyme builds (
USE_ENZYME=ON, static lib, no netCDF):Symbol audit, both hmaps: exactly one definition each and no unresolved Enzyme markers.
Isolated Python builds:
Exact HVP against centered FD on
ad_elliptok_lowres(n_dof=20, seed 42):fofull pipeline passed.