-
-
Notifications
You must be signed in to change notification settings - Fork 100
Add OptimizationMadNLP #1061
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
Add OptimizationMadNLP #1061
Conversation
14ce037
to
90f20ed
Compare
lagrangian, soadtype, x, Constant(one(eltype(x))), | ||
Constant(ones(eltype(x), num_cons)), Constant(p), strict = Val(false)) | ||
lag_hess_prototype = zeros(Bool, num_cons, length(x)) | ||
lag_hess_prototype = zeros(Bool, length(x), length(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the Hessian a square n*n matrix with n being the length of the vector we're taking derivatives against? All the tests that I've added error with out of bounds memory access otherwise. The tests don't catch this because we don't actually call with the generated prototype.
MadNLP tests failing |
yeah, it's due to the bug fixed in 90b5b1c, there are several bugs that lead to CI failures on the latest releases, which is why I was wondering if I should split those to a separate PR |
I split the bugfixes to #1069 |
90f20ed
to
e9747e1
Compare
I rebased, I'll bump the OptimizationBase compat once we have a release |
This is a wrapper for https://github.com/MadNLP/MadNLP.jl Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
no support in MadNLP :(
Co-authored-by: Claude <noreply@anthropic.com>
Fixes dimension mismatch errors when using sparse Lagrangian Hessians & corrects constraint Jacobian structure initialization Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Ensure Hessian buffers are created with numeric type T instead of inheriting Bool from sparsity prototypes. Fixes InexactError when storing Hessian values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
e9747e1
to
525fb64
Compare
Needs a follow up with a doc page, but since this is at least correct let's start the 3 day timer. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add wrapper for https://github.com/MadNLP/MadNLP.jl
Currently MadNLP does not support user defined callbacks :( I'll look into PRing that after this gets in.
While working on the tests I also found a couple of bugs in the AD subpackages and fixed them with some help from Claude Code. Should I PR the fixes separately? This passes the tests locally, but in CI it fails due to what I fixed in 90b5b1c
Speaking of bugs, I think the
SecondOrder
warning has a bug whenAutoSparse
is used, but I'm not sure if I should address that now. I seeThis is currently WIP, it needs[ ] callback support[ ] progress supportInterface wise, I'm wondering if I should make the
linear_solver
andkkt_system
more easily accessible instead of being in the additional options. The reason for the current approach is that MadNLP picks the defaults for those based on the system and in our optimizer struct we don't have the system yet. One option would be to use some dummy value that is then later translated internally.