Skip to content
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

Support exact Hessians of nonlinear objective and constraints in NonLinMPC and MovingHorizonEstimator #181

Open
franckgaga opened this issue Mar 22, 2025 · 2 comments

Comments

@franckgaga
Copy link
Member

@baggepinnen I think for Hessians, it would make sense to always default to sparse computations (when activated, I would keep the LBFGS approximation as the default)? Should it be pure ForwardDiff, or mixed mode?

@franckgaga
Copy link
Member Author

Also maybe @gdalle has tips on that subject ? Thanks!

@gdalle
Copy link

gdalle commented Mar 28, 2025

If your problems are reaasonably small, pure-ForwardDiff sparse Hessians are not a bad idea.
Otherwise you'd have to combine backends, and that's where it gets tricky:

  • ReverseDiff only remains alloc-free in the absence of constants
  • Zygote is of course not alloc-free, nor does it support mutation
  • Mooncake and Enzyme don't work as inner backends for ForwardDiff

Pure-Enzyme sparse Hessians would also be an option but at the moment they're not so optimized, and there are still bugs I don't understand with respect to DI.Cache in second-order Enzyme

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

No branches or pull requests

2 participants