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

Change nlpmodels.jl to use ConcreteStructs.jl #51

Merged
merged 10 commits into from Feb 3, 2024
Merged

Conversation

odow
Copy link
Collaborator

@odow odow commented Jan 21, 2024

Closes #50

@ccoffrin
Copy link
Member

Wait to hear from NLPModels developers before merging.

@ccoffrin
Copy link
Member

Something seems off in this variant. Any chance of an error in porting it from the source @odow? Maybe the new NLPModels sparsity detection does not work with this implementation?

Running pglib_opf_case162_ieee_dtc.m and larger cases with ma27 yields a segfault. Seems to work on smaller cases without any issue however.

Summary
   case........: /vast/home/cjc/nlp-comp/rosetta-opf/variants/../data/opf_warmup.m
   variables...: 32
   constraints.: 37
   feasible....: true
   cost........: 23069
   total time..: 39.215670108795166
     data time.: 10.816910028457642
     build time: 14.614044904708862
     solve time: 13.784715175628662

...
This is Ipopt version 3.14.4, running with linear solver ma27.

Number of nonzeros in equality constraint Jacobian...:  2168124
Number of nonzeros in inequality constraint Jacobian.:  1264368
Number of nonzeros in Lagrangian Hessian.............:  1101870

MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 39881755 to 79763510 and la from 2147483647 to 0 and factorize again.

[288931] signal (11.1): Segmentation fault
in expression starting at rosetta-opf/rosetta-opf-cli.jl:49
Segmentation fault (core dumped)

Current Correctness Check Table

Case Vars Cons JuMP NLPModels NLPModels-CS
case3_lmbd 24 28 5.81264e+03 5.81264e+03 5.81264e+03
case5_pjm 44 53 1.75519e+04 1.75519e+04 1.75519e+04
case14_ieee 118 169 2.17808e+03 2.17808e+03 2.17808e+03
case24_ieee_rts 266 315 6.33522e+04 6.33522e+04 6.33522e+04
case30_ieee 236 348 8.20852e+03 8.20852e+03 8.20852e+03
case30_as 236 348 8.03127e+02 8.03127e+02 8.03127e+02
case39_epri 282 401 1.38416e+05 1.38416e+05 1.38416e+05
case57_ieee 448 675 3.75893e+04 3.75893e+04 3.75893e+04
case60_c 518 737 9.26937e+04 9.26937e+04 9.26937e+04
case73_ieee_rts 824 987 1.89764e+05 1.89764e+05 1.89764e+05
case89_pegase 1042 1649 1.07286e+05 1.07286e+05 1.07286e+05
case118_ieee 1088 1539 9.72136e+04 9.72136e+04 9.72136e+04
case162_ieee_dtc 1484 2313 1.08076e+05 1.08076e+05 N.D.
case179_goc 1468 2200 7.54266e+05 7.54266e+05 N.D.
case197_snem 1608 2397 1.50165e+00 1.50165e+00 N.D.
case200_activ 1456 2116 2.75576e+04 2.75576e+04 N.D.
case240_pserc 2558 3617 3.32967e+06 3.32967e+06 N.D.
case300_ieee 2382 3478 5.65220e+05 5.65220e+05 N.D.
case500_goc 4254 6097 4.54946e+05 4.54946e+05 N.D.
case588_sdet 4110 5979 3.13140e+05 3.13140e+05 N.D.
case793_goc 5432 7978 2.60198e+05 2.60198e+05 N.D.
case1354_pegase 11192 16646 1.25884e+06 1.25884e+06 INF.
case1803_snem 15246 23172 9.83346e+04 9.83346e+04 INF.
case1888_rte 14480 21494 1.40253e+06 1.40253e+06 INF.
case1951_rte 15018 22075 2.08558e+06 2.08558e+06 INF.
case2000_goc 19008 29432 9.73432e+05 9.73432e+05 INF.
case2312_goc 17128 25716 4.41330e+05 4.41330e+05 INF.
case2383wp_k 17004 25039 1.86819e+06 1.86819e+06 INF.
case2736sp_k 19088 28356 1.30801e+06 1.30801e+06 INF.
case2737sop_k 18988 28358 7.77728e+05 7.77728e+05 INF.
case2742_goc 24540 38196 2.75705e+05 2.75705e+05 INF.
case2746wp_k 19520 28446 1.63171e+06 1.63171e+06 INF.
case2746wop_k 19582 28642 1.20826e+06 1.20826e+06 INF.
case2848_rte 21822 32129 1.28661e+06 N.D. INF.
case2853_sdet 23028 33154 2.05239e+06 2.05239e+06 INF.
case2868_rte 22090 32393 2.00961e+06 2.00961e+06 INF.
case2869_pegase 25086 37813 2.46279e+06 2.46279e+06 INF.
case3012wp_k 21082 31029 2.60084e+06 2.60084e+06 INF.
case3022_goc 23238 34990 6.01384e+05 N.D. INF.
case3120sp_k 21608 32092 2.14797e+06 2.14797e+06 INF.
case3375wp_k 24350 35876 7.43817e+06 7.43817e+06 INF.
case3970_goc 35270 54428 9.60985e+05 9.60985e+05 INF.
case4020_goc 36696 56957 8.22247e+05 8.22247e+05 INF.
case4601_goc 38814 59596 8.26242e+05 8.26242e+05 N.D.
case4619_goc 42532 66289 4.76704e+05 4.76704e+05 N.D.
case4661_sdet 34758 51302 2.25134e+06 N.D. INF.
case4837_goc 41398 64030 8.72255e+05 8.72255e+05 N.D.
case4917_goc 37872 56917 1.38779e+06 1.38779e+06 N.D.
case5658_epigrids 48552 74821 1.20731e+06 1.20731e+06 N.D.
case6468_rte 49734 75937 2.06973e+06 2.06973e+06 N.D.
case6470_rte 50482 75976 2.23757e+06 2.23757e+06 N.D.
case6495_rte 50426 76124 3.06783e+06 3.06783e+06 N.D.
case6515_rte 50546 76290 2.82550e+06 2.82550e+06 N.D.
case7336_epigrids 62116 95306 1.88239e+06 1.88239e+06 N.D.
case8387_pegase 78748 118702 2.77139e+06 N.D. N.D.
case9241_pegase 85568 130826 6.24309e+06 N.D. N.D.
case9591_goc 83572 130588 1.06168e+06 N.D. N.D.
case10000_goc 76804 112352 1.35403e+06 N.D. N.D.
case10192_epigrids 89850 139456 1.68692e+06 N.D. N.D.
case10480_goc 96750 150874 2.31465e+06 N.D. N.D.
case13659_pegase 117370 170588 8.94805e+06 N.D. N.D.
case19402_goc 179562 281733 1.97782e+06 N.D. N.D.
case20758_epigrids 179236 274918 2.61864e+06 N.D. N.D.
case24464_goc 203374 313641 2.62953e+06 N.D. N.D.
case30000_goc 208624 307752 1.14233e+06 N.D. N.D.
case78484_epigrids 674562 1039062 1.53159e+07 N.D. N.D.
  [54578032] ADNLPModels v0.7.0
  [7c4d4715] AmplNLWriter v1.2.0
  [2569d6c7] ConcreteStructs v0.2.3
  [992eb4ea] CondaPkg v0.2.22
  [b6b21f68] Ipopt v1.6.0
  [4076af6c] JuMP v1.18.1
  [309f4015] MathOptSymbolicAD v0.1.3
  [f4238b75] NLPModelsIpopt v0.10.1
  [7f7a1694] Optimization v3.21.1
  [fd9f6733] OptimizationMOI v0.3.4
  [c36e90e8] PowerModels v0.20.1
  [6099a3de] PythonCall v0.9.15
  [37e2e3b7] ReverseDiff v1.15.1
  [47a9eef4] SparseDiffTools v2.15.0
⌅ [9cc047cb] Ipopt_jll v300.1400.400+0

@ccoffrin
Copy link
Member

Same issue with the latest version of the deps,

This is Ipopt version 3.14.4, running with linear solver ma27.

Number of nonzeros in equality constraint Jacobian...:  2168124
Number of nonzeros in inequality constraint Jacobian.:  1264368
Number of nonzeros in Lagrangian Hessian.............:  1101870

MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 39881755 to 79763510 and la from 2147483647 to 0 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 79763510 to 159527020 and la from 0 to 9089024 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 159527020 to 319054040 and la from 9089024 to 20113270 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 319054040 to 638108080 and la from 20113270 to 42180350 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 638108080 to 1276216160 and la from 42180350 to 86314510 and factorize again.
MA27BD returned iflag=-4 and requires more memory.
 Increase liw from 1276216160 to 2147483647 and la from 86314510 to 174582830 and factorize again.

[309988] signal (11.1): Segmentation fault
in expression starting at rosetta-opf/rosetta-opf-cli.jl:49
  [54578032] ADNLPModels v0.7.0
  [7c4d4715] AmplNLWriter v1.2.0
  [2569d6c7] ConcreteStructs v0.2.3
  [992eb4ea] CondaPkg v0.2.22
  [b6b21f68] Ipopt v1.6.0
  [4076af6c] JuMP v1.18.1
  [309f4015] MathOptSymbolicAD v0.1.3
  [f4238b75] NLPModelsIpopt v0.10.1
  [7f7a1694] Optimization v3.21.2
  [fd9f6733] OptimizationMOI v0.3.4
  [c36e90e8] PowerModels v0.21.0
  [6099a3de] PythonCall v0.9.15
  [37e2e3b7] ReverseDiff v1.15.1
  [47a9eef4] SparseDiffTools v2.16.0
⌅ [9cc047cb] Ipopt_jll v300.1400.400+0

@odow
Copy link
Collaborator Author

odow commented Jan 30, 2024

TODO:

  • check if this is an issue between MUMPS and MA27

@odow
Copy link
Collaborator Author

odow commented Jan 30, 2024

@ccoffrin I think you need to take another look here. I couldn't reproduce this.

variables: 5432, 5432, 5432
constraints: 7978, 7978, 7978
This is Ipopt version 3.14.4, running with linear solver ma27.

Number of nonzeros in equality constraint Jacobian...:    22203
Number of nonzeros in inequality constraint Jacobian.:     5478
Number of nonzeros in Lagrangian Hessian.............:     9695

Total number of variables............................:     5432
                     variables with only lower bounds:        0
                variables with lower and upper bounds:     4639
                     variables with only upper bounds:        0
Total number of equality constraints.................:     5239
Total number of inequality constraints...............:     2739
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:      913
        inequality constraints with only upper bounds:     1826

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  2.4542765e+05 6.60e+00 1.08e+02  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  2.5958444e+05 5.99e+00 9.71e+01  -1.0 5.02e+00    -  6.28e-03 9.25e-02h  3
   2  2.5712907e+05 5.94e+00 9.61e+01  -1.0 1.99e+01    -  1.40e-02 8.08e-03f  1
   3  2.5242837e+05 5.80e+00 9.38e+01  -1.0 1.44e+01    -  2.41e-02 2.28e-02f  1
   4  2.4964555e+05 5.62e+00 8.16e+01  -1.0 1.29e+01    -  1.36e-01 3.09e-02f  1
   5  2.4950286e+05 5.03e+00 6.52e+01  -1.0 1.27e+01    -  2.02e-01 1.06e-01h  1
   6  2.5036292e+05 4.43e+00 3.77e+01  -1.0 4.44e+01    -  4.17e-01 1.19e-01h  2
   7  2.5136583e+05 3.68e+00 2.30e+01  -1.0 6.85e+01    -  3.79e-01 1.69e-01h  2
   8  2.5268111e+05 2.92e+00 1.31e+01  -1.0 7.69e+01    -  4.53e-01 2.06e-01h  2
   9  2.5559875e+05 1.59e+00 5.39e+00  -1.0 8.09e+01    -  9.09e-01 4.56e-01H  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  2.5814357e+05 5.50e-01 2.60e+00  -1.0 1.00e+02    -  4.32e-01 6.54e-01H  1
  11  2.5909071e+05 3.60e-01 3.93e+00  -1.0 5.50e+01    -  1.48e-01 3.44e-01h  1
  12  2.5977126e+05 2.55e-01 2.44e+00  -1.0 5.22e+01    -  3.89e-01 2.93e-01h  1
  13  2.6077256e+05 1.08e-01 4.50e+00  -1.0 5.58e+01    -  2.04e-01 6.14e-01h  1
  14  2.6145786e+05 2.99e-02 5.01e+00  -1.0 2.52e+01    -  4.13e-01 6.96e-01h  1
  15  2.6173819e+05 5.04e-04 3.23e+00  -1.0 1.33e+01    -  5.39e-01 1.00e+00h  1
  16  2.6169151e+05 1.43e-04 3.83e-02  -1.0 5.91e+00    -  1.00e+00 1.00e+00h  1
  17  2.6118346e+05 2.63e-03 9.11e-01  -2.5 4.33e+00    -  4.31e-01 3.61e-01f  1
  18  2.6072168e+05 5.93e-03 1.61e+00  -2.5 2.67e+00    -  3.63e-01 5.71e-01f  1
  19  2.6047647e+05 4.95e-03 1.30e+00  -2.5 1.84e+00    -  4.83e-01 5.82e-01f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  20  2.6038677e+05 5.26e-02 9.50e-01  -2.5 1.44e+00    -  7.34e-01 4.11e-01h  1
  21  2.6028377e+05 3.97e-03 1.02e+00  -2.5 1.78e+00    -  1.00e+00 6.67e-01h  1
  22  2.6024420e+05 2.16e-03 1.06e+00  -2.5 7.58e-01    -  1.00e+00 7.39e-01h  1
  23  2.6023929e+05 5.90e-04 1.97e-02  -2.5 1.81e-01    -  1.00e+00 9.96e-01h  1
  24  2.6021622e+05 4.24e-04 1.48e+00  -3.8 2.43e-01    -  6.47e-01 5.09e-01f  1
  25  2.6020604e+05 1.09e-03 5.97e-01  -3.8 1.59e-01    -  4.81e-01 5.81e-01h  1
  26  2.6020252e+05 4.10e-04 6.11e+00  -3.8 1.27e-01    -  3.10e-01 5.53e-01h  1
  27  2.6019979e+05 2.16e-04 6.84e-01  -3.8 7.88e-02    -  9.63e-01 8.97e-01h  1
  28  2.6019955e+05 1.79e-05 2.05e-04  -3.8 4.63e-02    -  1.00e+00 1.00e+00h  1
  29  2.6019885e+05 1.95e-05 7.18e-01  -5.7 8.08e-02    -  8.74e-01 3.96e-01h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  30  2.6019819e+05 3.04e-05 5.80e-01  -5.7 8.47e-02    -  8.53e-01 6.49e-01h  1
  31  2.6019789e+05 1.63e-05 2.07e-01  -5.7 4.77e-02    -  1.00e+00 9.24e-01h  1
  32  2.6019787e+05 7.90e-07 1.11e-03  -5.7 1.11e-02    -  1.00e+00 1.00e+00h  1
  33  2.6019787e+05 1.85e-08 1.89e-05  -5.7 7.21e-04    -  1.00e+00 1.00e+00h  1
  34  2.6019787e+05 5.33e-11 8.96e-10  -5.7 3.29e-05    -  1.00e+00 1.00e+00h  1
  35  2.6019785e+05 1.02e-07 5.09e-02  -8.6 4.01e-03    -  9.94e-01 9.52e-01f  1
  36  2.6019785e+05 3.30e-09 4.19e-06  -8.6 3.57e-04    -  1.00e+00 1.00e+00h  1
  37  2.6019785e+05 2.36e-12 2.71e-10  -8.6 6.60e-06    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 37

                                   (scaled)                 (unscaled)
Objective...............:   3.5138129355658789e+03    2.6019784787865335e+05
Dual infeasibility......:   2.7073821764503351e-10    2.0048165016614731e-08
Constraint violation....:   1.9260149031197216e-12    2.3576973706695981e-12
Variable bound violation:   1.0894180668685749e-07    1.0894180668685749e-07
Complementarity.........:   2.5109936211354074e-09    1.8593907764507692e-07
Overall NLP error.......:   2.5109936211354074e-09    1.8593907764507692e-07


Number of objective function evaluations             = 54
Number of objective gradient evaluations             = 38
Number of equality constraint evaluations            = 54
Number of inequality constraint evaluations          = 54
Number of equality constraint Jacobian evaluations   = 38
Number of inequality constraint Jacobian evaluations = 38
Number of Lagrangian Hessian evaluations             = 37
Total seconds in IPOPT                               = 17.351

EXIT: Optimal Solution Found.

Summary
   case........: data/pglib_opf_case793_goc.m
   variables...: 5432
   constraints.: 7978
   feasible....: true
   cost........: 260198
   total time..: 45.31116199493408
     data time.: 0.1353919506072998
     build time: 27.82262921333313
     solve time: 17.353139877319336

Dict{String, Any} with 10 entries:
  "cost"        => 2.60198e5
  "variables"   => 5432
  "constraints" => 7978
  "case"        => "data/pglib_opf_case793_goc.m"
  "time_total"  => 45.3112
  "time_build"  => 27.8226
  "solution"    => Dict("p_775_11_54"=>0.147535, "p_279_311_279"=>-0.0537034, "va_765"=>-0.327553, "vm_304"=>1.04048, "p_290_301_287"=
  "time_solve"  => 17.3531
  "time_data"   => 0.135392
  "feasible"    => true

Can you double check the error log for the first failing case?

@ccoffrin
Copy link
Member

Good to know! What OS were you testing on?

@odow
Copy link
Collaborator Author

odow commented Jan 30, 2024

Intel MacOS. Using HSL from https://licences.stfc.ac.uk/product/libhsl

@ccoffrin
Copy link
Member

ccoffrin commented Jan 31, 2024

I think the linear solver issue is a red herring. I tried re-running with mumps, there were no crashes but time outs at case240_pserc and above. The issue appears to be with sparsity detection not working. For the case data/pglib_opf_case793_goc.m your example shows,

variables: 5432, 5432, 5432
constraints: 7978, 7978, 7978
This is Ipopt version 3.14.4, running with linear solver ma27.

Number of nonzeros in equality constraint Jacobian...:    22203
Number of nonzeros in inequality constraint Jacobian.:     5478
Number of nonzeros in Lagrangian Hessian.............:     9695

Total number of variables............................:     5432
                     variables with only lower bounds:        0
                variables with lower and upper bounds:     4639
                     variables with only upper bounds:        0
Total number of equality constraints.................:     5239
Total number of inequality constraints...............:     2739
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:      913
        inequality constraints with only upper bounds:     1826

mine shows,

This is Ipopt version 3.14.4, running with linear solver MUMPS 5.4.1.

Number of nonzeros in equality constraint Jacobian...: 28458248
Number of nonzeros in inequality constraint Jacobian.: 14878248
Number of nonzeros in Lagrangian Hessian.............: 14756028

Total number of variables............................:     5432
                     variables with only lower bounds:        0
                variables with lower and upper bounds:     4639
                     variables with only upper bounds:        0
Total number of equality constraints.................:     5239
Total number of inequality constraints...............:     2739
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:      913
        inequality constraints with only upper bounds:     1826

This is the exact file I am using, https://github.com/lanl-ansi/rosetta-opf/blob/cli-testing/variants/nlpmodels-cs.jl, maybe it is somehow different from the one you are using?

@odow
Copy link
Collaborator Author

odow commented Jan 31, 2024

What is versioninfo() and ] st -m?

@ccoffrin
Copy link
Member

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 56 × Intel(R) Xeon(R) CPU E5-2695 v3 @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, haswell)
  Threads: 17 on 56 virtual cores
Environment:
  LD_LIBRARY_PATH = /projects/opt/centos8/x86_64/R/4.1.2/lib64:/vast/home/cjc/bin/knitro-12.2.2-Linux-64/lib:/vast/home/cjc/bin/HSL/lib/lib:/home/cjc/bin/gurobi952/linux64/lib
  DYLD_LIBRARY_PATH = /vast/home/cjc/.julia/v0.6/Mosek/deps/src/mosek/8/tools/platform/linux64x86:
  JULIA_IPOPT_LIBRARY_PATH = /vast/home/cjc/bin/Ipopt-3.12.4.2021/lib
  JULIA_IPOPT_EXECUTABLE_PATH = /vast/home/cjc/bin/Ipopt-3.12.4.2021/bin
  JULIA_NUM_THREADS = 12

(variants) pkg> st -m
Status `~/nlp-comp/rosetta-opf/variants/Manifest.toml`
  [54578032] ADNLPModels v0.7.0
  [47edcb42] ADTypes v0.2.6
  [14f7f29c] AMD v0.5.3
  [1520ce14] AbstractTrees v0.4.4
⌅ [79e6a3ab] Adapt v3.7.2
  [7c4d4715] AmplNLWriter v1.2.0
  [ec485272] ArnoldiMethod v0.2.0
  [4fba245c] ArrayInterface v7.7.0
  [4c555306] ArrayLayouts v1.5.2
  [6e4b80f9] BenchmarkTools v1.4.0
  [e2ed5e7c] Bijections v0.1.6
  [62783981] BitTwiddlingConvenienceFunctions v0.1.5
  [2a0fbf3d] CPUSummary v0.2.4
  [00ebfdb7] CSTParser v3.4.0
  [49dc2e85] Calculus v0.5.1
  [d360d2e6] ChainRulesCore v1.20.1
  [fb6a15b2] CloseOpenIntervals v0.1.12
  [523fee87] CodecBzip2 v0.8.1
  [944b1d66] CodecZlib v0.7.4
  [ffa27691] ColPack v0.3.0
  [861a8166] Combinatorics v1.0.2
  [a80b9123] CommonMark v0.8.12
  [38540f10] CommonSolve v0.2.4
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v4.12.0
  [b152e2b5] CompositeTypes v0.1.3
  [2569d6c7] ConcreteStructs v0.2.3
  [992eb4ea] CondaPkg v0.2.22
  [88cd18e8] ConsoleProgressMonitor v0.1.2
  [187b0558] ConstructionBase v1.5.4
  [adafc99b] CpuId v0.3.1
  [a8cc5b0e] Crayons v4.1.1
  [9a962f9c] DataAPI v1.16.0
  [864edb3b] DataStructures v0.18.16
  [e2d170a0] DataValueInterfaces v1.0.0
  [2b5f629d] DiffEqBase v6.146.0
  [459566f4] DiffEqCallbacks v2.36.1
  [163ba53b] DiffResults v1.1.0
  [b552c78f] DiffRules v1.15.1
  [b4f34e82] Distances v0.10.11
  [31c24e10] Distributions v0.25.107
  [ffbed154] DocStringExtensions v0.9.3
⌅ [5b8099bc] DomainSets v0.6.7
  [fa6b7ba4] DualNumbers v0.6.8
  [7c1d4256] DynamicPolynomials v0.5.3
  [4e289a0a] EnumX v1.0.4
  [f151be2c] EnzymeCore v0.6.5
  [d4d017d3] ExponentialUtilities v1.25.0
  [e2ba6199] ExprTools v0.1.10
  [7034ab61] FastBroadcast v0.2.8
  [9aa1b823] FastClosures v0.3.2
  [29a986be] FastLapackInterface v2.0.1
  [1a297f60] FillArrays v1.9.3
  [6a86dc24] FiniteDiff v2.22.0
  [59287772] Formatting v0.4.2
  [f6369f11] ForwardDiff v0.10.36
  [069b7b12] FunctionWrappers v1.1.3
  [77dc65aa] FunctionWrappersWrappers v0.1.3
  [d9f16b24] Functors v0.4.5
⌃ [46192b85] GPUArraysCore v0.1.5
  [c145ed77] GenericSchur v0.5.3
  [c27321d9] Glob v1.3.1
  [86223c79] Graphs v1.9.0
  [3e5b6fbb] HostCPUFeatures v0.1.16
  [34004b35] HypergeometricFunctions v0.3.23
  [615f187c] IfElse v0.1.1
  [d25df0c9] Inflate v0.1.4
  [2030c09a] InfrastructureModels v0.7.8
  [8197267c] IntervalSets v0.7.8
  [b6b21f68] Ipopt v1.6.0
  [92d709cd] IrrationalConstants v0.2.2
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.5.0
  [682c06a0] JSON v0.21.4
  [0f8b85d8] JSON3 v1.14.0
  [4076af6c] JuMP v1.18.1
  [98e50ef6] JuliaFormatter v1.0.45
  [ccbc3e58] JumpProcesses v9.10.1
  [ef3ab10e] KLU v0.4.1
  [ba0b0d4f] Krylov v0.9.5
  [40e66cde] LDLFactorizations v0.10.1
  [b964fa9f] LaTeXStrings v1.3.1
  [2ee39098] LabelledArrays v1.15.0
  [984bce1d] LambertW v0.4.6
  [23fbe1c1] Latexify v0.16.1
  [10f19ff3] LayoutPointers v0.1.15
  [50d2b5c4] Lazy v0.15.1
  [5078a376] LazyArrays v1.8.3
  [1d6d02ad] LeftChildRightSiblingTrees v0.2.0
  [d3d80556] LineSearches v7.2.0
  [5c8ed15e] LinearOperators v2.6.0
  [7ed4a6bd] LinearSolve v2.22.1
  [2ab3a3ac] LogExpFunctions v0.3.26
  [e6f89c97] LoggingExtras v1.0.3
  [bdcacae8] LoopVectorization v0.12.166
  [d8e11817] MLStyle v0.4.17
  [1914dd2f] MacroTools v0.5.13
  [d125e4d3] ManualMemory v0.1.8
  [b8f27783] MathOptInterface v1.25.2
  [309f4015] MathOptSymbolicAD v0.1.3
  [a3b82374] MatrixFactorizations v2.1.0
  [bb5d69b7] MaybeInplace v0.1.1
  [f28f55f0] Memento v1.4.1
  [0b3b1443] MicroMamba v0.1.14
  [e1d29d7a] Missings v1.1.0
  [961ee093] ModelingToolkit v8.75.0
  [46d2c3a1] MuladdMacro v0.2.4
  [102ac46a] MultivariatePolynomials v0.5.4
  [d8a4904e] MutableArithmetics v1.4.0
  [a4795742] NLPModels v0.20.0
  [f4238b75] NLPModelsIpopt v0.10.1
  [d41bc354] NLSolversBase v7.8.3
  [2774e3e8] NLsolve v4.5.1
  [77ba4419] NaNMath v1.0.2
  [8913a72c] NonlinearSolve v3.5.0
  [6fe1bfb0] OffsetArrays v1.13.0
  [7f7a1694] Optimization v3.21.2
  [fd9f6733] OptimizationMOI v0.3.4
  [bac558e1] OrderedCollections v1.6.3
  [1dea7af3] OrdinaryDiffEq v6.69.0
  [90014a1f] PDMats v0.11.31
  [65ce6f38] PackageExtensionCompat v1.0.2
  [d96e819e] Parameters v0.12.3
  [69de0a69] Parsers v2.8.1
  [fa939f87] Pidfile v1.3.0
  [e409e4f3] PoissonRandom v0.4.4
  [f517fe37] Polyester v0.7.9
  [1d0040c9] PolyesterWeave v0.2.1
  [c36e90e8] PowerModels v0.21.0
  [d236fae5] PreallocationTools v0.4.17
  [aea7be01] PrecompileTools v1.2.0
  [21216c6a] Preferences v1.4.1
  [33c8b6b6] ProgressLogging v0.1.4
  [92933f4c] ProgressMeter v1.9.0
  [6099a3de] PythonCall v0.9.15
  [1fd47b50] QuadGK v2.9.4
  [e6cf234a] RandomNumbers v1.5.3
  [3cdcf5f2] RecipesBase v1.3.4
  [731186ca] RecursiveArrayTools v3.6.2
  [f2c3362d] RecursiveFactorization v0.2.21
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [37e2e3b7] ReverseDiff v1.15.1
  [79098fc4] Rmath v0.7.1
  [7e49a35a] RuntimeGeneratedFunctions v0.5.12
  [94e857df] SIMDTypes v0.1.0
  [476501e8] SLEEFPirates v0.6.42
  [0bca4576] SciMLBase v2.21.1
  [c0aeaf25] SciMLOperators v0.3.7
  [6c6a2e73] Scratch v1.2.1
  [efcf1570] Setfield v1.1.1
  [727e6d20] SimpleNonlinearSolve v1.3.1
  [699a6c99] SimpleTraits v0.9.4
  [ce78b400] SimpleUnPack v1.1.0
  [ff4d7338] SolverCore v0.3.7
  [a2af1166] SortingAlgorithms v1.2.1
  [47a9eef4] SparseDiffTools v2.16.0
  [e56a9233] Sparspak v0.3.9
  [276daf66] SpecialFunctions v2.3.1
  [aedffcd0] Static v0.8.8
  [0d7ed370] StaticArrayInterface v1.5.0
  [90137ffa] StaticArrays v1.9.2
  [1e83bf80] StaticArraysCore v1.4.2
  [82ae8749] StatsAPI v1.7.0
  [2913bbd2] StatsBase v0.34.2
  [4c63d2b9] StatsFuns v1.3.0
  [7792a7ef] StrideArraysCore v0.5.2
  [856f2bd8] StructTypes v1.10.0
  [2efcf032] SymbolicIndexingInterface v0.3.5
  [d1185830] SymbolicUtils v1.5.0
  [0c5d862f] Symbolics v5.16.1
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.11.1
  [5d786b92] TerminalLoggers v0.1.7
  [8290d209] ThreadingUtilities v0.5.2
  [a759f4b9] TimerOutputs v0.5.23
  [0796e94c] Tokenize v0.5.28
  [3bb67fe8] TranscodingStreams v0.10.2
  [d5829a12] TriangularSolve v0.1.20
  [410a4b4d] Tricks v0.1.8
  [781d530d] TruncatedStacktraces v1.4.0
  [5c2747f8] URIs v1.5.1
  [3a884ed6] UnPack v1.0.2
  [1986cc42] Unitful v1.19.0
  [a7c27f48] Unityper v0.1.6
  [e17b2a0c] UnsafePointers v1.0.0
  [3d5dd08c] VectorizationBase v0.21.65
  [19fa3120] VertexSafeGraphs v0.2.0
  [ae81ac8f] ASL_jll v0.1.3+0
  [6e34b625] Bzip2_jll v1.0.8+1
  [f218ff0c] ColPack_jll v0.3.0+0
  [1d5cc7b8] IntelOpenMP_jll v2024.0.2+0
⌅ [9cc047cb] Ipopt_jll v300.1400.400+0
  [d00139f3] METIS_jll v5.1.2+0
  [856f044c] MKL_jll v2024.0.0+0
⌅ [d7ed1dd3] MUMPS_seq_jll v5.4.1+0
⌅ [656ef2d0] OpenBLAS32_jll v0.3.24+0
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [f50d1b31] Rmath_jll v0.4.0+0
  [f8abcde7] micromamba_jll v1.4.9+0
  [0dad84c5] ArgTools v1.1.1
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8ba89e20] Distributed
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [4af54fe1] LazyArtifacts
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.10.0
  [de0858da] Printf
  [9abbd945] Profile
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays v1.10.0
  [10745b16] Statistics v1.10.0
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll v1.0.5+1
  [deac9b47] LibCURL_jll v8.4.0+0
  [e37daf67] LibGit2_jll v1.6.4+0
  [29816b5a] LibSSH2_jll v1.11.0+1
  [c8ffd9c3] MbedTLS_jll v2.28.2+1
  [14a3606d] MozillaCACerts_jll v2023.1.10
  [4536629a] OpenBLAS_jll v0.3.23+2
  [05823500] OpenLibm_jll v0.8.1+2
  [bea87d4a] SuiteSparse_jll v7.2.1+1
  [83775a58] Zlib_jll v1.2.13+1
  [8e850b90] libblastrampoline_jll v5.8.0+1
  [8e850ede] nghttp2_jll v1.52.0+1
  [3f19e933] p7zip_jll v17.4.0+2
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`

@odow
Copy link
Collaborator Author

odow commented Jan 31, 2024

Ah. I can reproduce with the current variants/Project.toml. But not with the original commit I had before you merged

https://github.com/lanl-ansi/rosetta-opf/tree/7afb335764408e1d217799de30af0793ca997d83

So I guess some recent version broke sparsity detection?

@ccoffrin
Copy link
Member

ccoffrin commented Feb 1, 2024

Ok mystery solved. I did a diff with your version and mine and the difference was import Symbolics. It turns out the way one turns on the sparsity feature in NLPModels is by importing Symbolics. I introduced the bug when moving the code into the variants directory and cleaning up package dependencies.

Data collection is underway!

@odow
Copy link
Collaborator Author

odow commented Feb 1, 2024

Oh. I didn't even think to consider the new package extensions. This is one downside to automagical behavior happening if you use the right set of packages...

@ccoffrin
Copy link
Member

ccoffrin commented Feb 1, 2024

Agreed!

@ccoffrin
Copy link
Member

ccoffrin commented Feb 1, 2024

Here are the "total runtime" results I am getting now. These now seem correct to me, do you agree?

Case Vars Cons NLPModels NLPModels-CS
case3_lmbd 24 28 5.10e-02 2.89e-02
case5_pjm 44 53 1.58e-01 1.15e-01
case14_ieee 118 169 2.73e-01 1.99e-01
case24_ieee_rts 266 315 7.72e-01 5.81e-01
case30_ieee 236 348 7.03e-01 5.00e-01
case30_as 236 348 6.32e-01 5.69e-01
case39_epri 282 401 6.59e-01 4.05e-01
case57_ieee 448 675 1.05e+00 1.09e+00
case60_c 518 737 1.84e+00 9.22e-01
case73_ieee_rts 824 987 2.56e+00 1.53e+00
case89_pegase 1042 1649 6.96e+00 3.84e+00
case118_ieee 1088 1539 5.36e+00 2.45e+00
case162_ieee_dtc 1484 2313 6.69e+00 4.50e+00
case179_goc 1468 2200 9.79e+00 4.63e+00
case197_snem 1608 2397 6.88e+00 4.47e+00
case200_activ 1456 2116 5.47e+00 3.57e+00
case240_pserc 2558 3617 5.16e+01 1.82e+01
case300_ieee 2382 3478 1.22e+01 7.64e+00
case500_goc 4254 6097 3.01e+01 1.84e+01
case588_sdet 4110 5979 2.31e+01 1.56e+01
case793_goc 5432 7978 3.80e+01 2.64e+01
case1354_pegase 11192 16646 1.61e+02 1.12e+02
case1803_snem 15246 23172 3.37e+02 2.03e+02
case1888_rte 14480 21494 5.32e+02 N.D.
case1951_rte 15018 22075 3.30e+02 2.26e+02
case2000_goc 19008 29432 4.05e+02 3.30e+02
case2312_goc 17128 25716 3.14e+02 2.16e+02
case2383wp_k 17004 25039 2.76e+02 1.95e+02
case2736sp_k 19088 28356 3.04e+02 2.48e+02
case2737sop_k 18988 28358 2.89e+02 2.40e+02
case2742_goc 24540 38196 1.12e+03 7.05e+02
case2746wp_k 19520 28446 3.13e+02 2.45e+02
case2746wop_k 19582 28642 N.D. 2.56e+02
case2848_rte 21822 32129 6.41e+02 4.26e+02
case2853_sdet 23028 33154 8.73e+02 5.33e+02
case2868_rte 22090 32393 7.12e+02 4.80e+02
case2869_pegase 25086 37813 8.32e+02 6.72e+02
case3012wp_k 21082 31029 4.36e+02 3.44e+02
case3022_goc 23238 34990 7.99e+02 5.53e+02
case3120sp_k 21608 32092 4.61e+02 3.69e+02
case3375wp_k 24350 35876 6.49e+02 5.33e+02
case3970_goc 35270 54428 1.97e+03 1.53e+03
case4020_goc 36696 56957 2.07e+03 1.62e+03
case4601_goc 38814 59596 2.30e+03 1.95e+03
case4619_goc 42532 66289 2.47e+03 2.30e+03
case4661_sdet 34758 51302 1.51e+03 1.24e+03
case4837_goc 41398 64030 2.24e+03 2.05e+03
case4917_goc 37872 56917 2.12e+03 1.68e+03
case5658_epigrids 48552 74821 3.41e+03 3.04e+03
case6468_rte 49734 75937 4.18e+03 3.36e+03
case6470_rte 50482 75976 3.70e+03 3.24e+03
case6495_rte 50426 76124 4.59e+03 3.70e+03
case6515_rte 50546 76290 4.20e+03 3.40e+03
case7336_epigrids 62116 95306 5.35e+03 5.04e+03
case8387_pegase 78748 118702 N.D. N.D.
case9241_pegase 85568 130826 N.D. N.D.
case9591_goc 83572 130588 N.D. N.D.
case10000_goc 76804 112352 N.D. N.D.
case10192_epigrids 89850 139456 N.D. N.D.
case10480_goc 96750 150874 N.D. N.D.
case13659_pegase 117370 170588 N.D. N.D.
case19402_goc 179562 281733 N.D. N.D.
case20758_epigrids 179236 274918 N.D. N.D.
case24464_goc 203374 313641 N.D. N.D.
case30000_goc 208624 307752 N.D. N.D.
case78484_epigrids 674562 1039062 N.D. N.D.

@odow
Copy link
Collaborator Author

odow commented Feb 1, 2024 via email

@odow
Copy link
Collaborator Author

odow commented Feb 1, 2024

There's an argument for it to be the default since it looks faster across the board. But I guess it doesn't solve any new cases, so it's the same order of magnitude in performance.

@ccoffrin ccoffrin merged commit 21f950c into main Feb 3, 2024
5 checks passed
@ccoffrin ccoffrin deleted the od/nlp-models branch February 3, 2024 04:49
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.

Use type-stable nlpmodels
2 participants