Cap AutoEnzyme Lagrangian Hessian batches at width 8 - #1340
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Cap AutoEnzyme Lagrangian Hessian batches at width 8#1340ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
ChrisRackauckas-Claude
force-pushed
the
fix/enzyme-lagrangian-hessian-batches
branch
from
September 6, 2026 06:52
ca50051 to
65f0594
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.
What changed and why
OptimizationBase now computes generated
AutoEnzymeLagrangian Hessians in batches capped at width 8. Inputs larger than 8 use repeated fixed-width calls with zero tangent padding in the final batch, reusing the private policy and caches already used for objective Hessians.OptimizationMOI requests
lag_hfor non-symbolic constrained problems. That path still differentiated every variable in oneBatchDuplicated, so its LLVM compile time grew sharply with problem size even after objective Hessian batching was added in #1331. This change covers both dense and packed in-place Lagrangian Hessian outputs, is internal, and adds no public API or dependency.Failing before and passing after
The same 17-parameter regression test computes and checks dense and packed Lagrangian Hessians, then verifies that the generated closure captures the width-8 policy.
Clean
origin/masterwith the test applied:This branch:
A focused Julia 1.11.9 reproducer using the exact 183-variable, 120-constraint
clnlbeamequations loaded theOptimizationEnzymeExtpath and checked its result against the analytic Hessian:The reduced three-backend benchmark sequence also discriminated the change:
Verification
The Runic check,
typoson both changed files, andgit diff --checkall exited successfully with no output.The exact Julia 1.11.9 SciMLBenchmarks page completed against this source tree and the refreshed registered stack:
The generated markdown had no error, exception, failure, unstable, or timeout markers. It produced a non-degenerate 576x384 plot with all six benchmark series, and every embedded objective/solution assertion passed.
Not verified
GROUP=Everything, GPU, and Julia prerelease jobs were not run locally.The main review judgment is reusing the existing fixed private width of 8 for Lagrangian Hessians. A row-at-a-time implementation also avoids the wide batch, but the width-8 version retains batching and reduced the focused first call by about 18 times.
Links
🤖 Generated with Claude Code
https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512