doc: add enzyme integration demo + blog post#542
Open
dionhaefner wants to merge 32 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #542 +/- ##
==========================================
+ Coverage 68.30% 77.95% +9.64%
==========================================
Files 39 39
Lines 4635 4635
Branches 754 754
==========================================
+ Hits 3166 3613 +447
+ Misses 1224 716 -508
- Partials 245 306 +61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fix the three failing checks on the Enzyme proof-of-concept PR:
- test-docs: add an explicit MyST anchor to the "What's next" heading in
the Fortran/Enzyme blog post so the in-page cross-reference resolves
(Sphinx treats the unresolved-xref warning as an error).
- tests-e2e (enzyme_ad): the e2e harness requires every examples/ dir to
have a TEST_CASES entry. Add enzyme_ad with check_gradients=True, a
regression test case (test_cases/test_apply.json) with analytically
computed expected output, and a check-gradients input. Verified locally:
the full build + apply + check-gradients + serve test passes.
- tests-demos (enzyme_thermal_2d): the demo lane auto-discovers every
demo/ dir and runs requirements.txt + demo.ipynb. This dir had neither
and the notebook loaded pre-built images (including a jax-thermal-2d
Tesseract absent from this branch). Make it a self-contained, runnable
demo:
* add requirements.txt
* rewrite the notebook as demo.ipynb: build + serve the Enzyme
Tesseract in-notebook, drive both inverse problems (scalar
calibration + 900-parameter thermal forensics) with
jax.value_and_grad through tesseract-jax, and tear down at the end
* add a Tikhonov term to the forensics loss so the recovered field
matches the blog (~0.98 correlation)
* add an abstract_eval endpoint to the 2D tesseract_api.py and make
the input validators abstract-safe (skip on ShapeDType, drop
field-level gt constraints that can't apply to abstract scalars) so
tesseract-jax transforms work
Verified locally: demo notebook executes end-to-end with no errors and
blog-consistent results.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
conf.py copies every demo/*/demo.ipynb into docs/content/demo/, so the new
enzyme_thermal_2d demo notebook needs a toctree entry or the docs build fails
("document isn't included in any toctree", with warnings treated as errors).
Add it to the demos toctree and a description card.
Verified locally: `SPHINXOPTS="-W" make html` succeeds with no warnings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Realign the blog post with the rewritten demo notebook, which drives both inverse problems with jax.value_and_grad via Tesseract-JAX rather than the manual vector_jacobian_product API: - Introduce apply_tesseract + a solve() helper up front, and use jax.value_and_grad in the Part 1 snippet (matching demo.ipynb). - Fold the standalone "JAX integration via Tesseract-JAX" section into a short wrap-up, keeping the swap-for-pure-JAX and layers-of-indirection points without re-introducing the code as if it were new. - Note the Tikhonov regularization the forensics problem now uses. - Soften result claims to match what the demo reproduces: k1 is weakly identifiable from 9 noisy sensors (k0 recovered well), and the 900-element field correlation is ~0.98 rather than ">0.99". Verified locally: `SPHINXOPTS="-W" make html` succeeds with no warnings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reduce vertical whitespace in blog posts: - Code blocks: trim wrapper margin (1.5rem -> 1rem) and pre padding (1rem/1.25rem -> 0.7rem/1.1rem), and tighten the gap when a short intro line is immediately followed by a code block. Short one-line bash/python snippets no longer sit in oversized boxes. - Tables: size to content width (width:auto, capped at 100%) instead of stretching full-width, with a fit-content wrapper so the table isn't centered in an empty box, plus tighter row padding. The small 2-3 row comparison tables now waste far less horizontal and vertical space. All scoped to .blog-page so docs and landing pages are unaffected. Verified by rendering the Fortran/Enzyme post. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ore into dion/enzyme-demo
samalipio
reviewed
Jun 17, 2026
samalipio
left a comment
There was a problem hiding this comment.
Looks wicked. Dropped some optional suggestions.
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.
Relevant issue or PR
n/a
Description of changes
enzyme-lfortranshowcasing how to use Enzyme-differentiated Fortran solvers in optimization tasks via Tesseract + Tesseract-JAX.fortran_enzymeexplaining (and testing) Enzyme integration into arbitrary Tesseracts.{figure}MyST environments instead of<figure>raw HTML in all blog posts.AGENTS.mdthat should help agents working on demos in the future.Testing done
👀, new example + demo pass on CI