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

Allocations in FletcherPenaltyNLP #85

Open
tmigot opened this issue Sep 8, 2022 · 1 comment
Open

Allocations in FletcherPenaltyNLP #85

tmigot opened this issue Sep 8, 2022 · 1 comment

Comments

@tmigot
Copy link
Member

tmigot commented Sep 8, 2022

I used the following script:

using Pkg
Pkg.activate(".")
using LinearAlgebra, NLPModels, FletcherPenaltySolver
using NLPModelsTest # main version of NLPModelsTest

using NLPModelsTest

problems = ["HS6", "MGH01Feas"]
σ, ρ, δ = 1e-5, 1e1, 1e-7
map(
  nlp -> print_nlp_allocations(nlp, test_allocs_nlpmodels(nlp, linear_api = true, exclude = [hess])),
  map(x -> FletcherPenaltyNLP(eval(Symbol(x))(), σ, ρ, δ, Val(1)), problems),
)
map(
  nlp -> print_nlp_allocations(nlp, test_allocs_nlpmodels(nlp, linear_api = true, exclude = [hess])),
  map(x -> FletcherPenaltyNLP(eval(Symbol(x))(), σ, ρ, δ, Val(2)), problems),
)

which returns

  Problem name: Fletcher penalization of HS6_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 5440.0
              hess_op_prod!: ████████████████████ 5440.0

  Problem name: Fletcher penalization of MGH01Feas_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 5648.0
              hess_op_prod!: ████████████████████ 5648.0

  Problem name: Fletcher penalization of HS6_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 288.0
              hess_op_prod!: ████████████████████ 288.0

  Problem name: Fletcher penalization of MGH01Feas_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 320.0
              hess_op_prod!: ████████████████████ 320.0
@tmigot
Copy link
Member Author

tmigot commented Sep 8, 2022

After #86 , it is now

  Problem name: Fletcher penalization of HS6_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 5152.0
              hess_op_prod!: ████████████████████ 5152.0

  Problem name: Fletcher penalization of MGH01Feas_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ████████████████████ 5328.0
              hess_op_prod!: ████████████████████ 5328.0

  Problem name: Fletcher penalization of HS6_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
              hess_op_prod!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0

  Problem name: Fletcher penalization of MGH01Feas_manual
                        obj: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                      grad!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
                     hprod!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0
              hess_op_prod!: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0.0

so with the second approximation of the hessian it is 0-allocations!
The rest seems to come from the update of the operators...

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

No branches or pull requests

1 participant