SciML / Optimization.jl

Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.
https://docs.sciml.ai/Optimization/stable/
MIT License
691 stars 75 forks source link

Enormous unnecessary memory allocation #638

Closed baggepinnen closed 7 months ago

baggepinnen commented 7 months ago

The allocation of dense hessians of individual entries of a constraint vector taking place here https://github.com/SciML/Optimization.jl/blob/c178ba0d1178c102ea29fb85343538b606b8c33c/lib/OptimizationMOI/src/nlp.jl#L130

can easily lead to OOM errors for large problems, while allocation of a dense Lagrangian hessian only would be no problem.

baggepinnen commented 7 months ago

Hmm, it seems my lagh was provided in the wrong way and wasn't registered, the large arrays should not be allocated if the lagh prototype is passed