Enzyme
Enzyme copied to clipboard
Full hessian (c++)
I'd like to consider this library to support my interaction with ipopt. For that to work I need the gradient, Jacobian, and hessian of functions with respect to the optimisation variable or variables. To that end I also need to provide to ipopt sparsity patterns for the jacobian and hessian. I need the hessian, not the HVP etc. My code is c++ and interfaces to ipopt using c++.
Taking all of the above into account would I be able to use enzyme now? If not, what is missing?
Thanks
Is your Hessian sparse or dense? If dense, the Hessian can be computed efficiently using the HVP (ideally combined with batching). If sparse and you know the sparsity pattern, you can compute a coloring and efficiently obtain an assembled sparse Hessian using the HVP (some libraries, such as PETSc, will automate this for you). If you want Enzyme to figure out the sparsity pattern and put the matrix in a CSR format, I think that would be a new feature (don't know if Enzyme maintainers would consider it "patches welcome" or out of scope).
The hessian and jacobian are sparse. I do not know the sparsity pattern and need to obtain this from the library. CSR is ideal for both jacobian and hessian. I do not know the HvP nor does the library I'm coupling to require it. I had naively assumed that on computing derivatives for the jacobian and hessian the library knows it's a zero entry and the sparsity would "come for free"?
there is some work in Enzyme to automatically automate the sparsity detection x/ref https://c.wsmoses.com/presentations/weuroad23.pdf cc @martinjm97 @kmu @shoaibkamil
though that said patches/features generally always welcome (but if it's a more significant thing, probably worth a github discussion, or discussion at the weekly enzyme meeting
Thank you. Can you confirm at present dense (without sparsity calcs) hessian computations are possible? Is there an example of that?
Hi, just following this up. Could you confirm pure hessian computations are possible, dense or otherwise? Could you provide an example?
Thanks
Hi, just following this up. Could you confirm pure hessian computations are possible, dense or otherwise? Could you provide an example?
Thanks
Hi, just following this up. Any comments to help with this? Thanks
@a-jp I was wondering where you got to with this? Did you see the Hessian C code in the link in this issue? https://github.com/EnzymeAD/Enzyme/issues/1123
Thanks.