-
-
Notifications
You must be signed in to change notification settings - Fork 100
Clean up and update to OptimizationBase@v4 #1067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Make this a 4.0 and let's just do it. We are basically the only ones that depend on OptimizationBase directly so it's okay this didn't get lumped into the v3. |
|
I'm not sure how to handle the CI part. The Core CI for OptimizationBase uses OptimizationOptimJL, so if we have a breaking change, we can't CI it without doing both at the same time. Looking at Optimization.jl/test/runtests.jl Lines 17 to 27 in 2043290
so there are certain groups of packages that are intended to go together, but if we look at the CI logs, the Btw, if we do a v4, can we simplify the |
|
We just need to merge, release OptimizationBase v4, then downstream test via sources, then merge and release stuff. But the fact that v1.12 came out and the autodiff packages red X our CI just absolutely murders our ability to check this stuff automatically, so 😅 it's a bit rough right now. Let me make sure v2 backports are in a good spot first then we do this. Also, maybe we might want an IIP dispatch on this sooner or later? |
Yes, let's make something in SciMLBase like |
SciML/SciMLBase.jl#1157 adds Regarding CI, should I change the CI to use 1.11 instead of 1.12?
@ChrisRackauckas what do you mean by the IIP dispatch? |
|
Dispatching on whether its functions are in place |
|
so all the AD generated functions would have both variants and the loss is oop only? |
|
They are supposed to, they just don't right now. |
1b5d318 to
60285ce
Compare
Since we always dispatch on the optimizer, it makes much more sense to have this as the first argument (and first type parameter).
…mizationCache Co-authored-by: Claude <[email protected]>
|
I think |
003c646 to
2b5dfe8
Compare
Updates all optimizer packages to use SciMLBase.has_init (requires SciMLBase 2.122). Co-Authored-By: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
we can't use the julia-actions/julia-runtest@v1 action because that will resolve the environment before we get the chance to dev the required packages
for OptimizationAuglag & OptimizationMultistartOptimization
update location for IncompatibleOptimizerError fix bug in error
since the package directly depends on the other optimizers, we need to dev at the same time
expose linear_solver & kkt_system pass barrier options via MadNLP structs pass quasi_newton_options via MadNLP structs Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
The Enzyme extension's Hessian-vector product (HVP) implementation was
incorrectly using `Enzyme.make_zero(x)` which zeroed out the tangent
direction vector `v`, causing the forward-mode AD to have no direction
to differentiate in. This resulted in HVP always returning zeros.
Fixed by using the correct forward-over-reverse AD approach with the
existing `inner_grad` function, which properly computes H*v by taking
the gradient ∇f(θ) in reverse mode and differentiating it in forward
mode along direction v.
Fixes both in-place (OptimizationFunction{true}) and out-of-place
(OptimizationFunction{false}) versions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Changes SummaryCore Interface Refactoring (2 commits)
API Modernization (1 commit)
Test Infrastructure & Julia 1.11 Support (4 commits)
Package-Specific Test Fixes (9 commits)
Regarding the fixes for Documentation & Environment (3 commits)
Bug Fixes (1 commit)
|
`lag_h!` requires `cons_h!` for σ=0 case. Now generates `cons_h!` whenever `lag_h==true` to prevent `MethodError`. Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
When computing the Lagrangian Hessian with lag_h!, the case σ=0 requires special handling since it reduces to just the weighted sum of constraint Hessians (Σᵢ λᵢ∇²cᵢ) without the objective contribution. Previously, this case would fail when cons_h was not explicitly requested but lag_h was, because the constraint Hessian preparations were not created. This commit: - Always creates constraint Hessian preparations when either cons_h or lag_h is true - Adds cons_h_weighted!(H, θ, λ) function to compute the weighted sum directly into H - Updates lag_h! to use cons_h_weighted! when σ=0 This fixes the edge case in OptimizationMadNLP where the solver could hit σ=0 during iterations, particularly with exact Hessian and sparse KKT systems. Applies to both OptimizationDIExt and OptimizationZygoteExt. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Adds regression test to ensure lag_h! correctly handles the σ=0 case where the Lagrangian Hessian reduces to just the weighted sum of constraint Hessians. Tests both single and multiple constraint scenarios with different AD backends (ForwardDiff, ReverseDiff, Zygote). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Since we always dispatch on the optimizer, it makes much more sense
to have this as the first argument (and first type parameter).
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.