When solve with ipopt, we can use Jax to calculate the hessian matrix and jacobian instead of providing it ourselves. However, ipopt with Jax is very slow for large problems.

If we calculate the hessian matrix and jacobian ourselves and use the Problem interface, we can define their structures. Defining the hessian matrix and jacobian structures will make the solver faster, especially if sparse.

Can we use the Jax library to calculate the hessian matrix and jacobian and still be able to define the structures? I want to take the power of both.

Otherwise, using the problem interface and not Jax will be better.

Problem interface: https://cyipopt.readthedocs.io/en/stable/tutorial.html

  • 2
    $\begingroup$ Sounds like you're basically asking how to get sparse jacobians and Hessians with JAX. If so, there's a related github issue. $\endgroup$
    – joni
    Dec 17, 2022 at 10:19
  • $\begingroup$ That is what I am looking for. Hopefully they have an answer for it. Thanks. $\endgroup$ Dec 17, 2022 at 11:22
  • 1
    $\begingroup$ You might have better luck with mygrad for the hessian. It's a simple auto-diff tool made to work with Numpy. Jax may transfer to/from the GPU, and those boundaries can be obscure and slow. Also, if using Jax, you may need to figure out their JIT stuff and take advantage of that. $\endgroup$
    – Brannon
    Dec 22, 2022 at 12:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.