-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
Wait to hear from NLPModels developers before merging. |
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
Current Correctness Check Table
|
Same issue with the latest version of the deps,
|
TODO:
|
@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? |
Good to know! What OS were you testing on? |
Intel MacOS. Using HSL from https://licences.stfc.ac.uk/product/libhsl |
I think the linear solver issue is a red herring. I tried re-running with mumps, there were no crashes but time outs at
mine shows,
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? |
What is |
|
Ah. I can reproduce with the current https://github.com/lanl-ansi/rosetta-opf/tree/7afb335764408e1d217799de30af0793ca997d83 So I guess some recent version broke sparsity detection? |
Ok mystery solved. I did a diff with your version and mine and the difference was Data collection is underway! |
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... |
Agreed! |
Here are the "total runtime" results I am getting now. These now seem correct to me, do you agree?
|
Yes, that's more or less what I expected.
…On Thu, 1 Feb 2024, 6:20 pm Carleton Coffrin, ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6MQJLHGVMXMTNFOOKUEYTYRMQZBAVCNFSM6AAAAABCDYEACWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGUZTKMZUGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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. |
Closes #50