DiffOpt.jl icon indicating copy to clipboard operation
DiffOpt.jl copied to clipboard

Respect `MOI.AutomaticDifferentiationBackend()` in NLP

Open klamike opened this issue 7 months ago • 2 comments

The current code has SparseReverseMode hard-coded: https://github.com/jump-dev/DiffOpt.jl/blob/bf2c4c389ecd6ae63356e292b74a632b0517fa68/src/NonLinearProgram/nlp_utilities.jl#L94-L109

Perhaps backend should be set based on MOI.AutomaticDifferentiationBackend()? Besides the SymbolicMode, it would also allow to use DiffOpt with custom evaluators.

klamike avatar Jun 09 '25 22:06 klamike

We do need an attribute for setting that.

joaquimg avatar Aug 21 '25 13:08 joaquimg

We could use MOI.AutomaticDifferentiationBackend by default. We could have a different attribute in case the user wants a different AD than the solver but using the same as the solver to start with would be a good first step

blegat avatar Aug 25 '25 14:08 blegat