Skip to content

[MOI] Reuse existing data structures from MOI on re-solve - #550

Merged
amontoison merged 1 commit into
masterfrom
am/moi_resolve
Jan 22, 2026
Merged

amontoison merged 1 commit into
masterfrom
am/moi_resolve

Conversation

@amontoison

Copy link
Copy Markdown
Member

@amontoison amontoison changed the title [UnoSolver.jl] Reuse existing data structures from MOI on re-solve [MOI] Reuse existing data structures from MOI on re-solve Jan 8, 2026
@codecov

codecov Bot commented Jan 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.97%. Comparing base (610df61) to head (b887212).
⚠ïļ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   75.17%   84.97%   +9.79%     
==========================================
  Files          50       50              
  Lines        4617     4620       +3     
==========================================
+ Hits         3471     3926     +455     
+ Misses       1146      694     -452     

☔ View full report in Codecov by Sentry.
ðŸ“Ē Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ïļ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amontoison
amontoison force-pushed the am/moi_resolve branch 3 times, most recently from 2fc3614 to b7a3295 Compare January 8, 2026 21:47
@amontoison
amontoison changed the base branch from master to am/moi_precompile January 8, 2026 21:47
@amontoison
amontoison force-pushed the am/moi_resolve branch 2 times, most recently from d775b3f to 3719e35 Compare January 8, 2026 23:09
@amontoison
amontoison marked this pull request as ready for review January 8, 2026 23:19
@amontoison
amontoison requested a review from frapac January 8, 2026 23:19
@github-actions

github-actions Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/ext/MadNLPMOI/MOI_wrapper.jl b/ext/MadNLPMOI/MOI_wrapper.jl
index b1b7b86e..cb6af0b3 100644
--- a/ext/MadNLPMOI/MOI_wrapper.jl
+++ b/ext/MadNLPMOI/MOI_wrapper.jl
@@ -1435,7 +1435,7 @@ function _setup_model(model::Optimizer)
     model.jrows = jrows
     model.jcols = jcols
 
-    hessian_sparsity = has_hessian ? MOI.hessian_lagrangian_structure(model) : Tuple{Int,Int}[]
+    hessian_sparsity = has_hessian ? MOI.hessian_lagrangian_structure(model) : Tuple{Int, Int}[]
     nnzh = length(hessian_sparsity)
     hrows = Vector{Int}(undef, nnzh)
     hcols = Vector{Int}(undef, nnzh)

@amontoison

amontoison commented Jan 8, 2026 •

Copy link
Copy Markdown
Member Author

@franckgaga
We upgraded the MOI interface with François (#548 , #549, #550, #551) .
It could be relevant for you :)

@franckgaga

franckgaga commented Jan 9, 2026 •

Copy link
Copy Markdown

Niccee, many thanks 🙏

Is the VectorNonlinearOracle also ready for MadNLP?

@amontoison

Copy link
Copy Markdown
Member Author

Yes, we did it in #508.

@franckgaga

Copy link
Copy Markdown

Yess, thank you both, will give it a spin for NMPC, I had some trouble with the built-in L-BFGS solver in the past.

@amontoison

amontoison commented Jan 9, 2026 •

Copy link
Copy Markdown
Member Author

I worked a few hours recently on LBFGS and improved the implementation (see #537), I suggest to try it again when the release 0.9 will be available.

@frapac With this PR, I don't recreate the internal "MOI model" (with the expression tree, buffers for AD, coloring structures, etc...) if not needed but I never reuse the workspace of MadNLP.
Compared to Ipopt / KNITRO / Uno, we can also do that and it could be quite nice for @franckgaga.
We just need to use the in-place version of MadNLP (in a different PR).

@frapac frapac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from am/moi_precompile to master January 22, 2026 17:02
@amontoison
amontoison force-pushed the am/moi_resolve branch 2 times, most recently from fe162a8 to 23a0911 Compare January 22, 2026 17:22
@amontoison
amontoison merged commit b079a18 into master Jan 22, 2026
10 of 11 checks passed
@amontoison
amontoison deleted the am/moi_resolve branch January 22, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants