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

Full support of sparse AD for NLS models #239

Merged
merged 9 commits into from
Jun 22, 2024
Merged

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Jun 5, 2024

@tmigot Can you help me with it?

Copy link
Contributor

github-actions bot commented Jun 5, 2024

Package name latest stable
CaNNOLeS.jl
DCISolver.jl
DerivativeFreeSolvers.jl
JSOSolvers.jl
NLPModelsIpopt.jl
OptimalControl.jl
OptimizationProblems.jl
Percival.jl
QuadraticModels.jl
SolverBenchmark.jl
SolverTools.jl

@tmigot
Copy link
Member

tmigot commented Jun 6, 2024

@amontoison I keep this in my list. Could you rebase the branch?

@tmigot tmigot linked an issue Jun 6, 2024 that may be closed by this pull request
@amontoison amontoison force-pushed the sparse_hessian_nls branch 2 times, most recently from 1e002d5 to a01f52d Compare June 7, 2024 15:25
@amontoison amontoison changed the title Sparse hessian nls Full support of sparse AD for NLS models Jun 7, 2024
@amontoison
Copy link
Member Author

@amontoison I keep this in my list. Could you rebase the branch?

@tmigot Done

@tmigot
Copy link
Member

tmigot commented Jun 18, 2024

@amontoison I took care of the ADNLPModel-stuff, just rest to fix hess_structure_residual! and hess_coord_residual! for sparse backend.

src/sparse_hessian.jl Outdated Show resolved Hide resolved
src/sparse_hessian.jl Outdated Show resolved Hide resolved
test/sparse_hessian_nls.jl Show resolved Hide resolved
@amontoison amontoison force-pushed the sparse_hessian_nls branch 2 times, most recently from 1363b41 to f05d97d Compare June 18, 2024 21:31
@amontoison
Copy link
Member Author

@amontoison I took care of the ADNLPModel-stuff, just rest to fix hess_structure_residual! and hess_coord_residual! for sparse backend.

@tmigot I think we need to create the backend for residual_hessian with different arguments (f(x) = 0 and c(x) = F(x)).
You probably know how to fix that.

@amontoison
Copy link
Member Author

@tmigot
Copy link
Member

tmigot commented Jun 21, 2024

@tmigot Tu sais à quoi ça sert ces lignes? d37a9a1#diff-a1616586d29af268a473ea5c9c5ea6d09aa5f0de50e914a9d0bedc8d4f7bb59eR92-R99

C'est pour couvrir le cas où le "backend" fourni par l'utilisateur est un NLPModel. Mais définir cette fonction

function get_residual_nnzj(nlp::AbstractNLPModel, nvar, nequ)
  nlp.nls_meta.nnzj
end

devrait être suffisant je pense.

@amontoison amontoison marked this pull request as ready for review June 22, 2024 01:34
@amontoison amontoison requested a review from tmigot June 22, 2024 02:16
@amontoison
Copy link
Member Author

@tmigot All tests passed for Hessian but we probably need to update the API for jth_hess_residual.

@tmigot
Copy link
Member

tmigot commented Jun 22, 2024

Thanks for fixing it. I think the implementation in AD&NLPModels of jth_residual_hess is not clear so I removed the additional implementation (JuliaSmoothOptimizers/NLPModels.jl#466). It should work now

Copy link
Member

@tmigot tmigot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amontoison ! LGTM

@amontoison amontoison merged commit 4f55b76 into main Jun 22, 2024
32 of 38 checks passed
@amontoison amontoison deleted the sparse_hessian_nls branch June 22, 2024 15:28
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

Successfully merging this pull request may close these issues.

Add sparse backend for Hessian of residual for NLS models
2 participants