JuliaSmoothOptimizers / JuliaSmoothOptimizers/ADNLPModels.jl

Disable gradient and Hessian backends for NLSModels (part 2)

Open
#360 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
44
Forks
19
PR merge metrics
No merged PRs in 30d

Description

@amontoison @dpo I must say I don't like this PR https://github.com/JuliaSmoothOptimizers/ADNLPModels.jl/pull/357 . I am creating a new issue to continue the discussion.

I understand the issue that loading Hessian backends are heavy and that smart algorithms for NLS should use only the needed operations.

Before this PR, ADNPLModel implements the whole API, so it's simple for any users. Advanced users with performance needs had to know either the `matrix_free` keyword or specify the EmptyADBackend. It used to also be the only package that guarantee implementing the whole API.

After this PR, users have to specify the different backends to make ADNLPModels work with the rest of JSO.

For instance, these two examples would no longer work:
```
using ADNLPModels
using NLPModelsModifiers, NLPModelsIpopt, OptimizationProblems

nls = OptimizationProblems.ADNLPProblems.arglina(; use_nls=true)
ipopt(nls) # fails
ff_nls = FeasibilityFormNLS(nls)
ipopt(ff_nls) # fails
```
you would have to find the names of different backends for hess (in the first case) and hess_residual (in the second case) and choose between the different possibilities.

I am slightly surprised that the Breakage tests did not show that.

Overall, I agree that some backends should be Empty by default (like gradient), but the others ? Maybe can we extend on the keyword systems to simplify switch modes ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.