-
Notifications
You must be signed in to change notification settings - Fork 10
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
experiment with converting quadratic functions to nonlinear, to simplify/streamline code #67
Comments
Hmm I wonder if jump-dev/Ipopt.jl#320 slash jump-dev/MathOptInterface.jl#1397 may help here. |
Yes, I agree that having a bridge from ScalarQuadraticFunction to ScalarNonlinearFunction would be ideal and would simplify Pavito but it seems to be hard to handle constraints one by one, see jump-dev/MathOptInterface.jl#2059 (comment) |
I'm a little confused about that point. if our problem has a bunch of ScalarQuadraticFunctions constraints and ScalarNonlinearFunction constraints, and we bridge the SQFs to SNFs, then we have a problem with all SNFs. and that pure nonlinear model can be handled with a single NLP block - so all grad, Hess etc oracles can be done in one go |
Yes but it might be more efficient to create the grad/Hess oracles directly from the SQF and not from the SNF where we have lost the special quadratic structure. Otherwise, it could be bridged indeed, @odow is more familiar with the AD internals. |
Ok, I'd be surprised if it made much difference in practice, but yeah @odow would have a better idea than me of course. |
One thing to keep an eye out for is derivative performance on very large
problems. Jacobian and Hessian computations can be much faster for the
subset of linear and quadratic expressions than general nonlinear
expressions.
…On Mon, Jan 16, 2023 at 7:34 AM Chris Coey ***@***.***> wrote:
Ok, I'd be surprised if it made much difference in practice, but yeah
@odow <https://github.com/odow> would have a better idea than me of
course.
—
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIN5KW75A6RHIZUOUFIP7TWSU533ANCNFSM6AAAAAAT32OEVY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This would be an issue for the nonlinear solver, so we would want to preserve quadraticness there. but for deriving cuts from gradients for the OA mip solver, it shouldn't matter because the costs would surely be dwarfed. |
Yes. That's reasonable once we have an ScalarNonlinearExpression in MOI.
The default JuMP AD has support for detecting linear expressions, but not quadratic.
Yeah. For the trade-off, the overhead of Pavito going back and forward to the MIP solver, etc, is probably larger than the AD cost of explicit quadratic versus an NLP version of quadratic. |
8 months later... we should take another look at this |
Yeah! I won't have time in the next few months I think, but happy if anyone else wants to try it |
Pavito is harder to maintain, debug, and read/understand while the quadratic functions are handled separately from the more general nonlinear functions.
after ScalarNonlinearFunction is finalized and jump-dev/MathOptInterface.jl#2059 is in, I think we should think about perhaps a bridge from ScalarQuadraticFunction to ScalarNonlinearFunction in MOI, or if not a bridge then a more manual conversion inside Pavito.
@odow any thoughts? I'd like to have a shot at this when the time is right.
The text was updated successfully, but these errors were encountered: