HiGHS.jl icon indicating copy to clipboard operation
HiGHS.jl copied to clipboard

Updating to 1.18.0 (or 1.18.1) slows down optimization considerably

Open jhmenke opened this issue 7 months ago • 19 comments

Continuing here from the original issue in the HiGHS github repo. Basically since updating HiGHS.jl from 1.17.0 the solve time is much slower across multiple machines. Cross testing with the highs.exe and a .mps file show that HiGHS itself it not slower in the 1.11.0 release.

The effect happens if i build the JuMP model and solve without saving as an .mps file (which is how i noticed this issue) but also when using the .mps file and simply solving that in a different julia instance.

debug_model.zip

This is the log output for HiGHS 1.10.0 (HiGHS.jl 1.17.0):

Running HiGHS 1.10.0 (git hash: fd8665394e): Copyright (c) 2025 HiGHS under MIT licence terms LP has 991849 rows; 1097468 cols; 3829286 nonzeros Coefficient ranges: Matrix [1e-05, 5e+03] Cost [1e-02, 3e+06] Bound [1e-04, 2e+07] RHS [3e-02, 9e+06] Presolving model 876074 rows, 961701 cols, 3426946 nonzeros 1s 543435 rows, 898128 cols, 2723024 nonzeros 3s Dependent equations search running on 49965 equations with time limit of 1000.00s Dependent equations search removed 316 rows and 24487 nonzeros in 1.87s (limit = 1000.00s) 537606 rows, 892770 cols, 2666088 nonzeros 8s Presolve : Reductions: rows 537606(-454243); columns 892770(-204698); elements 2666088(-1163198) Solving the presolved LP Using EKK dual simplex solver - serial Iteration Objective Infeasibilities num(sum) 0 -8.1306717279e+02 Ph1: 24276(4.79758e+08); Du: 174(813.067) 10s 82948 3.5204077749e+11 Pr: 108132(2.59337e+09); Du: 0(1.15995e-05) 15s 139806 4.1386524513e+11 Pr: 105914(1.75352e+10); Du: 0(1.18632e-05) 20s 181120 4.1631569446e+11 Pr: 102932(5.86065e+10); Du: 0(1.37198e-05) 26s 221052 4.1832780990e+11 Pr: 91897(1.07374e+12); Du: 0(1.3871e-05) 31s 242079 4.1834255032e+11 Pr: 84872(9.85533e+10); Du: 0(1.30607e-05) 36s 250131 4.1834883532e+11 Pr: 83740(4.71013e+10); Du: 0(1.30512e-05) 42s 267980 4.1837001219e+11 Pr: 78442(2.14453e+09); Du: 0(1.24289e-05) 47s 307082 4.1841594670e+11 Pr: 64345(2.06726e+09); Du: 0(1.0861e-05) 53s 354099 4.1846333776e+11 Pr: 48402(1.85511e+08); Du: 0(1.073e-05) 58s 404536 4.1847811591e+11 Pr: 21643(1.7926e+07); Du: 0(9.90774e-06) 63s 431979 4.1820295991e+11 Pr: 0(0); Du: 13038(545.571) 79s 434395 4.1820287747e+11 Pr: 0(0); Du: 9724(4.77047) 90s 439395 4.1820281951e+11 Pr: 0(0); Du: 10308(593.899) 107s 444131 4.1820280474e+11 Pr: 0(0); Du: 6910(1.36408) 122s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 130s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 130s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 130s Using EKK primal simplex solver Iteration Objective Infeasibilities num(sum) 446820 4.1820280416e+11 Pr: 0(0); Du: 17(7.94029e-05) 131s 446850 4.1820280416e+11 Pr: 0(0); Du: 0(8.43066e-06) 131s Solving the original LP from the solution after postsolve Model status : Optimal Simplex iterations: 446850 Objective value : 4.1820280416e+11 Relative P-D gap : 4.5243356212e-15 HiGHS run time : 133.14 --- Results --- Termination Status: OPTIMAL Objective Value: 4.182028041574081e11

This is the log output for HiGHS 1.11.0:

Running HiGHS 1.11.0 (git hash: 364c83a51e): Copyright (c) 2025 HiGHS under MIT licence terms LP has 991849 rows; 1097468 cols; 3829286 nonzeros Coefficient ranges: Matrix [1e-05, 5e+03] Cost [1e-02, 3e+06] Bound [1e-04, 2e+07] RHS [3e-02, 9e+06] Presolving model 876074 rows, 961701 cols, 3426946 nonzeros 1s 543435 rows, 898128 cols, 2723024 nonzeros 3s Dependent equations search running on 49965 equations with time limit of 1000.00s Dependent equations search removed 316 rows and 24487 nonzeros in 1.92s (limit = 1000.00s) 537606 rows, 892770 cols, 2666088 nonzeros 8s Presolve : Reductions: rows 537606(-454243); columns 892770(-204698); elements 2666088(-1163198) Solving the presolved LP Using EKK dual simplex solver - serial Iteration Objective Infeasibilities num(sum) 0 -8.1306717279e+02 Ph1: 24276(4.79758e+08); Du: 174(813.067) 11s 3765 3.0902601573e+11 Pr: 90896(3.38809e+10); Du: 0(6.57882e-13) 17s 8416 3.0915915992e+11 Pr: 90662(1.81352e+10); Du: 0(8.18375e-08) 25s 13115 3.0922510291e+11 Pr: 107375(8.5505e+09); Du: 0(5.29026e-06) 33s 17987 3.0922698178e+11 Pr: 113970(2.4135e+09); Du: 0(1.28277e-05) 42s 22740 3.0924204235e+11 Pr: 115341(1.61926e+09); Du: 0(1.15052e-05) 50s 27154 3.0926595715e+11 Pr: 115775(2.74817e+09); Du: 0(1.23649e-05) 58s 31348 3.0934045509e+11 Pr: 116459(3.81402e+09); Du: 0(1.35052e-05) 65s 35526 3.0937760463e+11 Pr: 116066(4.27698e+09); Du: 0(1.40118e-05) 72s 40117 3.0938539580e+11 Pr: 115009(2.58928e+09); Du: 0(1.51462e-05) 80s 44048 3.0941776157e+11 Pr: 114817(1.61981e+09); Du: 0(1.56678e-05) 87s 48606 3.0942775290e+11 Pr: 115188(2.05915e+09); Du: 0(1.44851e-05) 95s 51487 3.0943590228e+11 Pr: 114711(2.22508e+09); Du: 0(1.44567e-05) 100s 57064 3.0945098691e+11 Pr: 113617(2.09603e+09); Du: 0(1.39369e-05) 110s 62586 3.2271569862e+11 Pr: 113589(1.32798e+09); Du: 0(1.34809e-05) 119s 65762 3.2271881980e+11 Pr: 112283(1.31657e+09); Du: 0(1.40249e-05) 125s 68731 3.2342123851e+11 Pr: 111738(4.6231e+09); Du: 0(1.27348e-05) 130s 71697 3.2342569780e+11 Pr: 110756(3.92603e+09); Du: 0(1.22021e-05) 135s 74646 3.3863408396e+11 Pr: 109830(1.85062e+09); Du: 0(1.2204e-05) 140s 77882 3.4953706221e+11 Pr: 108933(2.01818e+09); Du: 0(1.14844e-05) 146s 80935 3.4953891903e+11 Pr: 108091(2.03458e+09); Du: 0(1.14396e-05) 151s 86693 3.5585250033e+11 Pr: 106258(2.50634e+09); Du: 0(1.23738e-05) 162s 90544 4.0313938577e+11 Pr: 104177(2.51803e+09); Du: 0(1.26828e-05) 168s 94125 4.0314249737e+11 Pr: 102983(3.67182e+09); Du: 0(1.28837e-05) 175s 96868 4.0314410217e+11 Pr: 102313(5.5417e+09); Du: 0(1.32279e-05) 180s 100911 4.1252237992e+11 Pr: 100493(1.01914e+10); Du: 0(1.26498e-05) 188s 104512 4.1252611189e+11 Pr: 100579(6.56678e+09); Du: 0(1.27173e-05) 194s 107547 4.1252737748e+11 Pr: 101469(6.62902e+09); Du: 0(1.21357e-05) 200s 112942 4.1346949004e+11 Pr: 103106(8.68737e+09); Du: 0(1.17417e-05) 210s 116385 4.1347153771e+11 Pr: 103458(1.70209e+10); Du: 0(1.13463e-05) 216s 120718 4.1347366703e+11 Pr: 103186(1.70274e+10); Du: 0(1.13816e-05) 224s 124927 4.1347598018e+11 Pr: 104879(1.60065e+10); Du: 0(1.08756e-05) 231s 128441 4.1386134920e+11 Pr: 105799(2.29403e+10); Du: 0(1.10109e-05) 238s 132365 4.1386248277e+11 Pr: 105657(2.7371e+10); Du: 0(1.13552e-05) 245s 136393 4.1386409512e+11 Pr: 105166(2.31434e+10); Du: 0(1.13849e-05) 252s 139806 4.1386524513e+11 Pr: 105914(1.75352e+10); Du: 0(1.18632e-05) 259s 143079 4.1386610613e+11 Pr: 106741(2.26076e+10); Du: 0(1.23849e-05) 265s 146395 4.1386809886e+11 Pr: 107084(7.6592e+09); Du: 0(1.25917e-05) 272s 149396 4.1386942531e+11 Pr: 106922(6.18176e+09); Du: 0(1.2711e-05) 277s 154752 4.1401853343e+11 Pr: 106870(1.24355e+10); Du: 0(1.2902e-05) 287s 158268 4.1402074126e+11 Pr: 107081(1.42145e+10); Du: 0(1.30716e-05) 294s 162445 4.1402237000e+11 Pr: 106194(1.33352e+10); Du: 0(1.30278e-05) 301s 165907 4.1577378270e+11 Pr: 105925(1.34177e+10); Du: 0(1.33144e-05) 308s 169726 4.1577464108e+11 Pr: 105798(4.88825e+10); Du: 0(1.30599e-05) 315s 173908 4.1577627265e+11 Pr: 105063(2.1454e+11); Du: 0(1.36659e-05) 322s 177353 4.1631442648e+11 Pr: 104305(1.22317e+11); Du: 0(1.36632e-05) 328s 181120 4.1631569446e+11 Pr: 102932(5.86065e+10); Du: 0(1.37198e-05) 335s 184408 4.1631663127e+11 Pr: 102384(5.50424e+10); Du: 0(1.37568e-05) 341s 188202 4.1631732213e+11 Pr: 102055(5.83492e+10); Du: 0(1.37706e-05) 348s 191048 4.1632070004e+11 Pr: 102028(6.22196e+10); Du: 0(1.38831e-05) 354s 194134 4.1632344070e+11 Pr: 102488(9.0224e+11); Du: 0(1.41068e-05) 360s 197408 4.1671546602e+11 Pr: 101461(9.02608e+11); Du: 0(1.44774e-05) 366s 200821 4.1671650854e+11 Pr: 99927(9.38028e+11); Du: 0(1.45397e-05) 372s 204617 4.1832191239e+11 Pr: 98637(9.77306e+11); Du: 0(1.45215e-05) 379s 208993 4.1832350606e+11 Pr: 96799(9.08884e+11); Du: 0(1.40095e-05) 387s 213257 4.1832502644e+11 Pr: 94659(1.03795e+12); Du: 0(1.41599e-05) 395s 217248 4.1832588206e+11 Pr: 93340(1.00667e+12); Du: 0(1.42124e-05) 402s 221052 4.1832780990e+11 Pr: 91897(1.07374e+12); Du: 0(1.3871e-05) 409s 224715 4.1832977942e+11 Pr: 90605(2.29043e+12); Du: 0(1.40442e-05) 416s 228987 4.1833204102e+11 Pr: 89037(2.15559e+12); Du: 0(1.36051e-05) 424s 233201 4.1833508203e+11 Pr: 86959(1.51406e+12); Du: 0(1.31443e-05) 431s 237304 4.1833935349e+11 Pr: 84362(1.32881e+10); Du: 0(1.30708e-05) 439s 239828 4.1834046403e+11 Pr: 84779(1.94792e+10); Du: 0(1.31283e-05) 445s 242079 4.1834255032e+11 Pr: 84872(9.85533e+10); Du: 0(1.30607e-05) 451s 244254 4.1834451574e+11 Pr: 85002(4.01549e+10); Du: 0(1.31603e-05) 457s 247704 4.1834722213e+11 Pr: 84394(4.81237e+10); Du: 0(1.31002e-05) 466s 250131 4.1834883532e+11 Pr: 83740(4.71013e+10); Du: 0(1.30512e-05) 472s 253493 4.1835176754e+11 Pr: 82860(2.4725e+10); Du: 0(1.30927e-05) 478s 257192 4.1835411402e+11 Pr: 81691(1.36421e+10); Du: 0(1.32889e-05) 485s 259648 4.1835837251e+11 Pr: 80788(1.27933e+10); Du: 0(1.28447e-05) 491s 262797 4.1836157175e+11 Pr: 79659(4.46918e+09); Du: 0(1.25464e-05) 497s 265439 4.1836589215e+11 Pr: 80057(2.80734e+10); Du: 0(1.25494e-05) 503s 267980 4.1837001219e+11 Pr: 78442(2.14453e+09); Du: 0(1.24289e-05) 509s 273389 4.1837695882e+11 Pr: 76630(9.38071e+09); Du: 0(1.27889e-05) 518s 278612 4.1838274298e+11 Pr: 74344(1.0729e+10); Du: 0(1.21641e-05) 528s 282607 4.1838609866e+11 Pr: 72792(8.51718e+09); Du: 0(1.22203e-05) 536s 288358 4.1839925625e+11 Pr: 70796(8.72504e+09); Du: 0(1.21655e-05) 546s 294034 4.1840397841e+11 Pr: 68670(1.07535e+10); Du: 0(1.19237e-05) 556s 296866 4.1840731219e+11 Pr: 67950(1.0434e+10); Du: 0(1.16077e-05) 561s 299702 4.1840956442e+11 Pr: 66504(9.58442e+09); Du: 0(1.14208e-05) 566s 302474 4.1841266024e+11 Pr: 65890(1.01092e+10); Du: 0(1.15103e-05) 571s 305327 4.1841478856e+11 Pr: 65075(3.44766e+09); Du: 0(1.12557e-05) 577s 308335 4.1841731885e+11 Pr: 64165(1.62996e+09); Du: 0(1.10489e-05) 583s 313831 4.1842200629e+11 Pr: 62688(5.31507e+09); Du: 0(1.10785e-05) 593s 319237 4.1843766705e+11 Pr: 61420(3.45169e+09); Du: 0(1.10618e-05) 603s 324735 4.1844247545e+11 Pr: 59765(7.07716e+09); Du: 0(1.03111e-05) 613s 330481 4.1844803872e+11 Pr: 57411(3.56661e+08); Du: 0(1.03199e-05) 623s 333208 4.1845040496e+11 Pr: 55985(1.66094e+08); Du: 0(1.03662e-05) 629s 336053 4.1845256163e+11 Pr: 55175(1.53718e+08); Du: 0(1.04367e-05) 634s 338991 4.1845507651e+11 Pr: 54054(1.37845e+08); Du: 0(1.04458e-05) 639s 341880 4.1845673415e+11 Pr: 52796(7.37586e+07); Du: 0(1.05466e-05) 644s 344911 4.1845913879e+11 Pr: 51571(3.95178e+07); Du: 0(1.06623e-05) 650s 347768 4.1846047665e+11 Pr: 50380(3.41628e+07); Du: 0(1.07054e-05) 655s 350942 4.1846230209e+11 Pr: 49377(7.22117e+07); Du: 0(1.07131e-05) 660s 354099 4.1846333776e+11 Pr: 48402(1.85511e+08); Du: 0(1.073e-05) 666s 357702 4.1846509820e+11 Pr: 46730(1.68877e+08); Du: 0(1.05993e-05) 673s 361685 4.1846679763e+11 Pr: 44937(3.73749e+07); Du: 0(1.02416e-05) 680s 365345 4.1846799659e+11 Pr: 43003(4.39791e+07); Du: 0(1.0342e-05) 687s 369219 4.1846929488e+11 Pr: 41264(4.23241e+07); Du: 0(1.05359e-05) 694s 373223 4.1847084964e+11 Pr: 39777(3.8881e+07); Du: 0(1.04102e-05) 701s 377245 4.1847215921e+11 Pr: 37897(2.04493e+07); Du: 0(1.03477e-05) 708s 380895 4.1847293691e+11 Pr: 34886(1.92678e+07); Du: 0(1.02931e-05) 715s 384795 4.1847387505e+11 Pr: 31996(1.82498e+07); Du: 0(1.10981e-05) 722s 388974 4.1847497906e+11 Pr: 29572(2.23558e+07); Du: 0(1.06676e-05) 730s 392995 4.1847578240e+11 Pr: 27063(1.86117e+07); Du: 0(1.04833e-05) 737s 397022 4.1847659238e+11 Pr: 25640(2.2202e+07); Du: 0(1.03746e-05) 744s 400453 4.1847738994e+11 Pr: 24394(2.21763e+07); Du: 0(1.01544e-05) 751s 404536 4.1847811591e+11 Pr: 21643(1.7926e+07); Du: 0(9.90774e-06) 759s 408740 4.1847870983e+11 Pr: 18737(1.77171e+07); Du: 0(9.64864e-06) 766s 413071 4.1847921471e+11 Pr: 15380(9.42481e+06); Du: 0(9.41245e-06) 774s 416611 4.1847948893e+11 Pr: 12734(3.50667e+06); Du: 0(9.38066e-06) 781s 420326 4.1847962494e+11 Pr: 9793(239035); Du: 0(9.3983e-06) 788s 424089 4.1847965796e+11 Pr: 6106(12152.6); Du: 0(9.5543e-06) 795s 428296 4.1847967120e+11 Pr: 1897(3.76768e+06); Du: 0(9.22094e-06) 802s 431979 4.1820295991e+11 Pr: 0(0); Du: 13038(545.571) 828s 434395 4.1820287747e+11 Pr: 0(0); Du: 9724(4.77047) 847s 439395 4.1820281951e+11 Pr: 0(0); Du: 10308(593.899) 874s 444131 4.1820280474e+11 Pr: 0(0); Du: 6910(1.36408) 900s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 914s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 914s 446820 4.1820280416e+11 Pr: 0(0); Du: 0(1.82748e-06) 914s Using EKK primal simplex solver Iteration Objective Infeasibilities num(sum) 446820 4.1820280416e+11 Pr: 0(0); Du: 17(7.94029e-05) 915s 446850 4.1820280416e+11 Pr: 0(0); Du: 0(8.43066e-06) 915s Solving the original LP from the solution after postsolve Model status : Optimal Simplex iterations: 446850 Objective value : 4.1820280416e+11 P-D objective error : 8.1000202251e-15 HiGHS run time : 917.32 --- Results --- Termination Status: OPTIMAL Objective Value: 4.182028041574032e11

I assume the iteration logs are time-based; the intermediary results seem to be more or less the same. This slowdow effect has been happening on my local laptop, on Azure VMs and on Azure DevBoxes.

=================================================================================

versioninfo() for HiGHS.jl 1.17.0:

Julia Version 1.11.5 Commit 760b2e5b73 (2025-04-14 06:53 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × AMD EPYC 7763 64-Core Processor WORD_SIZE: 64 LLVM: libLLVM-16.0.6 (ORCJIT, znver3) Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores) Environment: JULIA_EDITOR = code JULIA_VSCODE_REPL = 1

versioninfo() for updated HiGHS.jl is identical (same machine)

st -m for HiGHS 1.17.0

(proj) pkg> st -m Project proj v1.0.5 Status C:\work\proj.jl\Manifest.toml [14f7f29c] AMD v0.5.3 [79e6a3ab] Adapt v4.3.0 [13072b0f] AxisAlgorithms v1.1.0 [6e4b80f9] BenchmarkTools v1.6.0 [c3b6d118] BitIntegers v0.3.5 [336ed68f] CSV v0.10.15 [d360d2e6] ChainRulesCore v1.25.2 ⌅ [61c947e1] Clarabel v0.10.0 [da1fd8a2] CodeTracking v1.3.9 [523fee87] CodecBzip2 v0.8.5 [944b1d66] CodecZlib v0.7.8 [a80b9123] CommonMark v0.9.1 [bbf7d656] CommonSubexpressions v0.3.1 [34da2185] Compat v4.17.0 [807dbc54] Compiler v0.1.1 [992eb4ea] CondaPkg v0.2.29 [a8cc5b0e] Crayons v4.1.1 [a10d1c49] DBInterface v2.6.1 [9a962f9c] DataAPI v1.16.0 [a93c6f00] DataFrames v1.7.0 [864edb3b] DataStructures v0.18.22 [e2d170a0] DataValueInterfaces v1.0.0 [31a5f54b] Debugger v0.7.13 [163ba53b] DiffResults v1.1.0 [b552c78f] DiffRules v1.15.1 [ffbed154] DocStringExtensions v0.9.5 [d2f5444f] DuckDB v1.3.2 [e2ba6199] ExprTools v0.1.10 [48062228] FilePathsBase v0.9.24 [fb4d412d] FixedPointDecimals v0.6.3 [f6369f11] ForwardDiff v1.0.1 [60bf3e95] GLPK v1.2.1 [14197337] GenericLinearAlgebra v0.3.17 [c27321d9] Glob v1.3.1 [2e9cd046] Gurobi v1.7.5 ⌅ [34c5aeac] HSL v0.4.3 ⌃ [87dc4568] HiGHS v1.17.0 [eafb193a] Highlights v0.5.3 [842dd82b] InlineStrings v1.4.4 [a98d9a8b] Interpolations v0.16.1 [41ab1584] InvertedIndices v1.3.1 [92d709cd] IrrationalConstants v0.2.4 [82899510] IteratorInterfaceExtensions v1.0.0 [692b3bcd] JLLWrappers v1.7.0 [682c06a0] JSON v0.21.4 [0f8b85d8] JSON3 v1.14.3 [4076af6c] JuMP v1.26.0 [98e50ef6] JuliaFormatter v2.1.2 [aa1ae85d] JuliaInterpreter v0.10.3 ⌅ [70703baa] JuliaSyntax v0.4.10 [b964fa9f] LaTeXStrings v1.4.0 [0e77f7df] LazilyInitializedFields v1.3.0 [89398ba2] LocalRegistry v0.5.7 [2ab3a3ac] LogExpFunctions v0.3.29 [e6f89c97] LoggingExtras v1.1.0 [6f1432cf] LoweredCodeUtils v3.4.1 [1914dd2f] MacroTools v0.5.16 [b8f27783] MathOptInterface v1.42.0 [0b3b1443] MicroMamba v0.1.14 [93f3dd0f] MiniLoggers v0.5.3 [e1d29d7a] Missings v1.2.0 [d8a4904e] MutableArithmetics v1.6.4 [77ba4419] NaNMath v1.1.3 [6fe1bfb0] OffsetArrays v1.17.0 [bac558e1] OrderedCollections v1.8.1 ⌅ [46dd5b70] Pardiso v0.5.0 [69de0a69] Parsers v2.8.3 [fa939f87] Pidfile v1.3.0 [2dfb63ee] PooledArrays v1.4.3 ⌅ [aea7be01] PrecompileTools v1.2.1 [21216c6a] Preferences v1.4.3 [08abe8d2] PrettyTables v2.4.0 [6099a3de] PythonCall v0.9.25 [bfc457fd] QDLDL v0.4.1 [c84ed2f1] Ratios v0.4.5 [189a3867] Reexport v1.2.2 [2792f1a3] RegistryInstances v0.1.0 [d1eb7eb1] RegistryTools v2.3.0 [ae029012] Requires v1.3.1 [295af30f] Revise v3.8.0 [6c6a2e73] Scratch v1.3.0 [91c51154] SentinelArrays v1.4.8 [66db9d55] SnoopPrecompile v1.0.3 [a2af1166] SortingAlgorithms v1.2.1 [276daf66] SpecialFunctions v2.5.1 [90137ffa] StaticArrays v1.9.13 [1e83bf80] StaticArraysCore v1.4.3 [10745b16] Statistics v1.11.1 [892a3eda] StringManipulation v0.4.1 [856f2bd8] StructTypes v1.11.0 [3783bdb8] TableTraits v1.0.1 [bd369af6] Tables v1.12.1 [a759f4b9] TimerOutputs v0.5.29 [3bb67fe8] TranscodingStreams v0.11.3 [e17b2a0c] UnsafePointers v1.0.0 [ea10d353] WeakRefStrings v1.4.2 [efce3f68] WoodburyMatrices v1.0.0 [76eceee3] WorkerUtilities v1.6.1 [6e34b625] Bzip2_jll v1.0.9+0 [2cbbab25] DuckDB_jll v1.3.2+0 [e8aa6df9] GLPK_jll v5.0.1+1 ⌃ [c018c7e6] Gurobi_jll v12.0.1 ⚲ [017b0a0e] HSL_jll v4.0.2+0 ⌅ [8fd58aa0] HiGHS_jll v1.10.0+0 [1d5cc7b8] IntelOpenMP_jll v2025.0.4+0 [856f044c] MKL_jll v2025.0.1+1 [656ef2d0] OpenBLAS32_jll v0.3.29+0 [efe28fd5] OpenSpecFun_jll v0.5.6+0 [f8abcde7] micromamba_jll v1.5.8+0 [1317d2d5] oneTBB_jll v2022.0.0+0 [4d7b5844] pixi_jll v0.41.3+0 [0dad84c5] ArgTools v1.1.2 [56f22d72] Artifacts v1.11.0 [2a0f44e3] Base64 v1.11.0 [ade2ca70] Dates v1.11.0 [8ba89e20] Distributed v1.11.0 [f43a241f] Downloads v1.6.0 [7b1f6079] FileWatching v1.11.0 [9fa8497b] Future v1.11.0 [b77e0a4c] InteractiveUtils v1.11.0 [4af54fe1] LazyArtifacts v1.11.0 [b27032c2] LibCURL v0.6.4 [76f85450] LibGit2 v1.11.0 [8f399da3] Libdl v1.11.0 [37e2e46d] LinearAlgebra v1.11.0 [56ddb016] Logging v1.11.0 [d6f4376e] Markdown v1.11.0 [a63ad114] Mmap v1.11.0 [ca575930] NetworkOptions v1.2.0 [44cfe95a] Pkg v1.11.0 [de0858da] Printf v1.11.0 [9abbd945] Profile v1.11.0 [3fa0cd96] REPL v1.11.0 [9a3f8284] Random v1.11.0 [ea8e919c] SHA v0.7.0 [9e88b42a] Serialization v1.11.0 [1a1011a3] SharedArrays v1.11.0 [6462fe0b] Sockets v1.11.0 [2f01184e] SparseArrays v1.11.0 [f489334b] StyledStrings v1.11.0 [4607b0f0] SuiteSparse [fa267f1f] TOML v1.0.3 [a4e569a6] Tar v1.10.0 [8dfed614] Test v1.11.0 [cf7118a7] UUIDs v1.11.0 [4ec0a83e] Unicode v1.11.0 [e66e0078] CompilerSupportLibraries_jll v1.1.1+0 [781609d7] GMP_jll v6.3.0+0 [deac9b47] LibCURL_jll v8.6.0+0 [e37daf67] LibGit2_jll v1.7.2+0 [29816b5a] LibSSH2_jll v1.11.0+1 [c8ffd9c3] MbedTLS_jll v2.28.6+0 [14a3606d] MozillaCACerts_jll v2023.12.12 [4536629a] OpenBLAS_jll v0.3.27+1 [05823500] OpenLibm_jll v0.8.5+0 [bea87d4a] SuiteSparse_jll v7.7.0+0 [83775a58] Zlib_jll v1.2.13+1 [8e850b90] libblastrampoline_jll v5.11.0+0 [8e850ede] nghttp2_jll v1.59.0+0 [3f19e933] p7zip_jll v17.4.0+2

st -m for updated HiGHS.jl

(proj) pkg> st -m Project proj v1.0.5 Status C:\work\proj.jl\Manifest.toml [14f7f29c] AMD v0.5.3 [79e6a3ab] Adapt v4.3.0 [13072b0f] AxisAlgorithms v1.1.0 [6e4b80f9] BenchmarkTools v1.6.0 [c3b6d118] BitIntegers v0.3.5 [336ed68f] CSV v0.10.15 [d360d2e6] ChainRulesCore v1.25.2 ⌅ [61c947e1] Clarabel v0.10.0 [da1fd8a2] CodeTracking v1.3.9 [523fee87] CodecBzip2 v0.8.5 [944b1d66] CodecZlib v0.7.8 [a80b9123] CommonMark v0.9.1 [bbf7d656] CommonSubexpressions v0.3.1 [34da2185] Compat v4.17.0 [807dbc54] Compiler v0.1.1 [992eb4ea] CondaPkg v0.2.29 [a8cc5b0e] Crayons v4.1.1 [a10d1c49] DBInterface v2.6.1 [9a962f9c] DataAPI v1.16.0 [a93c6f00] DataFrames v1.7.0 [864edb3b] DataStructures v0.18.22 [e2d170a0] DataValueInterfaces v1.0.0 [31a5f54b] Debugger v0.7.13 [163ba53b] DiffResults v1.1.0 [b552c78f] DiffRules v1.15.1 [ffbed154] DocStringExtensions v0.9.5 [d2f5444f] DuckDB v1.3.2 [e2ba6199] ExprTools v0.1.10 [48062228] FilePathsBase v0.9.24 [fb4d412d] FixedPointDecimals v0.6.3 [f6369f11] ForwardDiff v1.0.1 [60bf3e95] GLPK v1.2.1 [14197337] GenericLinearAlgebra v0.3.17 [c27321d9] Glob v1.3.1 [2e9cd046] Gurobi v1.7.5 ⌅ [34c5aeac] HSL v0.4.3 [87dc4568] HiGHS v1.18.1 [eafb193a] Highlights v0.5.3 [842dd82b] InlineStrings v1.4.4 [a98d9a8b] Interpolations v0.16.1 [41ab1584] InvertedIndices v1.3.1 [92d709cd] IrrationalConstants v0.2.4 [82899510] IteratorInterfaceExtensions v1.0.0 [692b3bcd] JLLWrappers v1.7.0 [682c06a0] JSON v0.21.4 [0f8b85d8] JSON3 v1.14.3 [4076af6c] JuMP v1.26.0 [98e50ef6] JuliaFormatter v2.1.2 [aa1ae85d] JuliaInterpreter v0.10.3 ⌅ [70703baa] JuliaSyntax v0.4.10 [b964fa9f] LaTeXStrings v1.4.0 [0e77f7df] LazilyInitializedFields v1.3.0 [89398ba2] LocalRegistry v0.5.7 [2ab3a3ac] LogExpFunctions v0.3.29 [e6f89c97] LoggingExtras v1.1.0 [6f1432cf] LoweredCodeUtils v3.4.1 [1914dd2f] MacroTools v0.5.16 [b8f27783] MathOptInterface v1.42.0 [0b3b1443] MicroMamba v0.1.14 [93f3dd0f] MiniLoggers v0.5.3 [e1d29d7a] Missings v1.2.0 [d8a4904e] MutableArithmetics v1.6.4 [77ba4419] NaNMath v1.1.3 [6fe1bfb0] OffsetArrays v1.17.0 [bac558e1] OrderedCollections v1.8.1 ⌅ [46dd5b70] Pardiso v0.5.0 [69de0a69] Parsers v2.8.3 [fa939f87] Pidfile v1.3.0 [2dfb63ee] PooledArrays v1.4.3 ⌅ [aea7be01] PrecompileTools v1.2.1 [21216c6a] Preferences v1.4.3 [08abe8d2] PrettyTables v2.4.0 [6099a3de] PythonCall v0.9.25 [bfc457fd] QDLDL v0.4.1 [c84ed2f1] Ratios v0.4.5 [189a3867] Reexport v1.2.2 [2792f1a3] RegistryInstances v0.1.0 [d1eb7eb1] RegistryTools v2.3.0 [ae029012] Requires v1.3.1 [295af30f] Revise v3.8.0 [6c6a2e73] Scratch v1.3.0 [91c51154] SentinelArrays v1.4.8 [66db9d55] SnoopPrecompile v1.0.3 [a2af1166] SortingAlgorithms v1.2.1 [276daf66] SpecialFunctions v2.5.1 [90137ffa] StaticArrays v1.9.13 [1e83bf80] StaticArraysCore v1.4.3 [10745b16] Statistics v1.11.1 [892a3eda] StringManipulation v0.4.1 [856f2bd8] StructTypes v1.11.0 [3783bdb8] TableTraits v1.0.1 [bd369af6] Tables v1.12.1 [a759f4b9] TimerOutputs v0.5.29 [3bb67fe8] TranscodingStreams v0.11.3 [e17b2a0c] UnsafePointers v1.0.0 [ea10d353] WeakRefStrings v1.4.2 [efce3f68] WoodburyMatrices v1.0.0 [76eceee3] WorkerUtilities v1.6.1 [6e34b625] Bzip2_jll v1.0.9+0 [2cbbab25] DuckDB_jll v1.3.2+0 [e8aa6df9] GLPK_jll v5.0.1+1 ⌃ [c018c7e6] Gurobi_jll v12.0.1 ⚲ [017b0a0e] HSL_jll v4.0.2+0 [8fd58aa0] HiGHS_jll v1.11.0+1 [1d5cc7b8] IntelOpenMP_jll v2025.0.4+0 [856f044c] MKL_jll v2025.0.1+1 [656ef2d0] OpenBLAS32_jll v0.3.29+0 [efe28fd5] OpenSpecFun_jll v0.5.6+0 [f8abcde7] micromamba_jll v1.5.8+0 [1317d2d5] oneTBB_jll v2022.0.0+0 [4d7b5844] pixi_jll v0.41.3+0 [0dad84c5] ArgTools v1.1.2 [56f22d72] Artifacts v1.11.0 [2a0f44e3] Base64 v1.11.0 [ade2ca70] Dates v1.11.0 [8ba89e20] Distributed v1.11.0 [f43a241f] Downloads v1.6.0 [7b1f6079] FileWatching v1.11.0 [9fa8497b] Future v1.11.0 [b77e0a4c] InteractiveUtils v1.11.0 [4af54fe1] LazyArtifacts v1.11.0 [b27032c2] LibCURL v0.6.4 [76f85450] LibGit2 v1.11.0 [8f399da3] Libdl v1.11.0 [37e2e46d] LinearAlgebra v1.11.0 [56ddb016] Logging v1.11.0 [d6f4376e] Markdown v1.11.0 [a63ad114] Mmap v1.11.0 [ca575930] NetworkOptions v1.2.0 [44cfe95a] Pkg v1.11.0 [de0858da] Printf v1.11.0 [9abbd945] Profile v1.11.0 [3fa0cd96] REPL v1.11.0 [9a3f8284] Random v1.11.0 [ea8e919c] SHA v0.7.0 [9e88b42a] Serialization v1.11.0 [1a1011a3] SharedArrays v1.11.0 [6462fe0b] Sockets v1.11.0 [2f01184e] SparseArrays v1.11.0 [f489334b] StyledStrings v1.11.0 [4607b0f0] SuiteSparse [fa267f1f] TOML v1.0.3 [a4e569a6] Tar v1.10.0 [8dfed614] Test v1.11.0 [cf7118a7] UUIDs v1.11.0 [4ec0a83e] Unicode v1.11.0 [e66e0078] CompilerSupportLibraries_jll v1.1.1+0 [781609d7] GMP_jll v6.3.0+0 [deac9b47] LibCURL_jll v8.6.0+0 [e37daf67] LibGit2_jll v1.7.2+0 [29816b5a] LibSSH2_jll v1.11.0+1 [c8ffd9c3] MbedTLS_jll v2.28.6+0 [14a3606d] MozillaCACerts_jll v2023.12.12 [4536629a] OpenBLAS_jll v0.3.27+1 [05823500] OpenLibm_jll v0.8.5+0 [bea87d4a] SuiteSparse_jll v7.7.0+0 [83775a58] Zlib_jll v1.2.13+1 [8e850b90] libblastrampoline_jll v5.11.0+0 [8e850ede] nghttp2_jll v1.59.0+0 [3f19e933] p7zip_jll v17.4.0+2

jhmenke avatar Jul 15 '25 09:07 jhmenke

There's very little that changed in HiGHS.jl:

https://github.com/jump-dev/HiGHS.jl/compare/v1.17.0...v1.18.0

and your only packages that changed are:

(base) oscar@MacBookPro /tmp % diff old.txt new.txt
40c40
< ⌃ [87dc4568] HiGHS v1.17.0
---
> [87dc4568] HiGHS v1.18.1
107c107
< ⌅ [8fd58aa0] HiGHS_jll v1.10.0+0
---
> [8fd58aa0] HiGHS_jll v1.11.0+1
164d163
< st -m for updated HiGHS.jl

I'll see if I can reproduce locally.

odow avatar Jul 15 '25 21:07 odow

I can reproduce this, and I can confirm that it's something in HiGHS.jl.

This doesn't show the same issue:

import HiGHS_jll: libhighs
filename = "debug_model.mps"
highs = @ccall libhighs.Highs_create()::Ptr{Cvoid}
@ccall libhighs.Highs_readModel(highs::Ptr{Cvoid}, filename::Ptr{Cchar})::Cint
@ccall libhighs.Highs_run(highs::Ptr{Cvoid})::Cint

odow avatar Jul 15 '25 21:07 odow

The issue seems to be our trivial callback: https://github.com/jump-dev/HiGHS.jl/pull/292

@jajhall and @galabovaa did anything change with the callbacks between 1.10 and 1.11?

odow avatar Jul 15 '25 22:07 odow

The issue seems to be our trivial callback: #292

@jajhall and @galabovaa did anything change with the callbacks between 1.10 and 1.11?

There were some changes at the Python level, but nothing comes to mind immediately at the C/C++ level.

Naturally I'll look in more detail tomorrow

jajhall avatar Jul 15 '25 22:07 jajhall

It seems like there were a bunch of changes in https://github.com/ERGO-Code/HiGHS/pull/2278

cc @mathgeekcoder

The interrupt callbacks get called VERY frequently. Like 118711 times in 20 seconds. Is that really necessary?

odow avatar Jul 15 '25 22:07 odow

It seems like there were a bunch of changes in https://github.com/ERGO-Code/HiGHS/pull/2278

cc @mathgeekcoder

The interrupt callbacks get called VERY frequently. Like 118711 times in 20 seconds. Is that really necessary?

FYI: #2278 didn't change how frequently the callbacks are called (only the internal structure and some extra user solution features).

I'm guessing that interrupt is one of the simplex ones? It does seem a little excessive!

mathgeekcoder avatar Jul 15 '25 22:07 mathgeekcoder

I'll see if I can get a profile, but I don't know if I can easily measure from my side.

Maybe there's some issue casting between your difference callback objects?

https://github.com/ERGO-Code/HiGHS/pull/2278/files#diff-7fcfdaf7b66d8bd75ac0cbdf84c8e804915975035f1a085b1bb93ee94a34e721R99

Or does .clear() ing a vector have non-negligible cost?

https://github.com/ERGO-Code/HiGHS/pull/2278/files#diff-7fcfdaf7b66d8bd75ac0cbdf84c8e804915975035f1a085b1bb93ee94a34e721R32

odow avatar Jul 15 '25 22:07 odow

I ran this:

using PProf
import JuMP
import HiGHS
function main()
    model = JuMP.read_from_file("debug_model.mps")
    JuMP.set_optimizer(model, HiGHS.Optimizer)
    JuMP.set_attribute(model, "time_limit", 30.0)
    counter = Ref{Int}(0)
    function callback_fn(args...)
        counter[] += 1
        return Cint(0)    
    end
    loc = [HiGHS.kHighsCallbackSimplexInterrupt]
    JuMP.set_attribute(model, HiGHS.CallbackFunction(loc), callback_fn)
    @pprof JuMP.optimize!(model)
    return counter[]
end
main()

Got this flame graph. There's a memmove that couldn't be tied to any particular call and takes up 40% of total runtime:

Image Image

The middle red copy_to is JuMP copying the model into HiGHS.

Of Highs_run, there's a suspicious free_large

Image

So I'm going to call foul with something in the callback routine that is moving memory, and we're doing it every time the callback is hit, which is ~every simplex iteration.

odow avatar Jul 15 '25 23:07 odow

The interrupt callbacks get called VERY frequently. Like 118711 times in 20 seconds. Is that really necessary?

FYI: #2278 didn't change how frequently the callbacks are called (only the internal structure and some extra user solution features).

I'm guessing that interrupt is one of the simplex ones? It does seem a little excessive!

Yes, the culprit is the simplex interrupt, that is (and always was) called every iteration. My instinct had been to call it every time the basis was inverted, but I remember someone giving a reason for wanting it every iteration. The overhead has never been reported as meaningful until v1.11.0.

Looking at https://github.com/ERGO-Code/HiGHS/blame/master/highs/simplex/HEkk.cpp, only line 3428

callback_->clearHighsCallbackOutput();

has changed in the past 2 years, and this relates to the code changed by @mathgeekcoder in

https://github.com/ERGO-Code/HiGHS/blame/master/highs/lp_data/HighsCallback.cpp

jajhall avatar Jul 15 '25 23:07 jajhall

Thanks for your profiling. I'm not yet sure where the issue is, but I wouldn't be surprised if it were me somewhere.

Maybe there's some issue casting between your difference callback objects?

I don't see anything obvious that could cause slow down here either.

Or does .clear() ing a vector have non-negligible cost?

By the C++ standard, clearing should only set the size of the vector, it should not impact memory allocation.

I'll see if I can reproduce on my end, which will make it easier to debug.

mathgeekcoder avatar Jul 16 '25 00:07 mathgeekcoder

By the C++ standard, clearing should only set the size of the vector, it should not impact memory allocation.

Wait... The C++ standard doesn't free the memory but can invalidate it. This will call the destructor on each element (linear time), however this is a no-op for built-in types (double). The compiler should optimize this out, so that it is constant time - but it's possibly not guaranteed.

I'm somewhat skeptical that this is the issue, but I will investigate further.

mathgeekcoder avatar Jul 16 '25 00:07 mathgeekcoder

I removed all of the Julia side of the callback with the same result. So I think there is an issue somewhere on the C side. I'll try and write you a c reproducer

odow avatar Jul 16 '25 01:07 odow

The plot thickens. I can't reproduce this from C. So maybe it is an issue crossing the C/Julia language barrier.

For example this was fine:

#include "interfaces/highs_c_api.h"

#include <stdio.h>
#include <stdlib.h>

void callback_fn(
    const int callback_type,
    const char* message,
    const HighsCallbackDataOut* data_out,
    HighsCallbackDataIn* data_in,
    void* user_callback_data) {
    (*(int*)(user_callback_data))++;
    data_in->user_interrupt = 0;
    return;
}

int main(int argc, char *argv[]) {
    void* highs = Highs_create();
    int ret;
    ret = Highs_readModel(highs, "/tmp/debug_model.mps");
    ret = Highs_setDoubleOptionValue(highs, "time_limit", 30.0);
    int count = 0;
    void* p_count = (void*)(&count);
    ret = Highs_setCallback(highs, callback_fn, p_count);
    ret = Highs_startCallback(highs, kHighsCallbackSimplexInterrupt);
    ret = Highs_run(highs);
    printf("count = %d\n", count);
    Highs_destroy(highs);
    return 0;
}
Running HiGHS 1.11.0 (git hash: 768d44e71): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0168s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
      58880     3.0925275084e+11 Pr: 126319(7.25565e+09); Du: 0(1.55167e-05) 11s
     113736     3.5129678624e+11 Pr: 106122(4.19701e+09); Du: 0(1.2555e-05) 17s
     164384     4.1346194185e+11 Pr: 94386(3.47686e+09); Du: 0(1.23915e-05) 22s
     217985     4.1670186760e+11 Pr: 85779(2.3378e+09); Du: 0(1.27243e-05) 27s
     237475     4.1831373113e+11 30s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 237475
Objective value     :  4.1803783137e+11
HiGHS run time      :         30.12
count = 237548

odow avatar Jul 16 '25 02:07 odow

I really don't understand. This is a problem with the binaries we have compiled for HiGHS_jll, but not locally.

[email protected] and my local 1.11 are good, whether called from C or Julia.

[email protected] is bad, whether called from C or Julia.

Good: [email protected] from Julia

julia> import HiGHS_jll: libhighs

julia> cb(::Cint, ::Ptr{Cchar}, ::Ptr{Cvoid}, ::Ptr{Cvoid}, ::Ptr{Cvoid}) = nothing
cb (generic function with 1 method)

julia> function main()
           highs = @ccall libhighs.Highs_create()::Ptr{Cvoid}
           @ccall libhighs.Highs_readModel(highs::Ptr{Cvoid}, "debug_model.mps"::Ptr{Cchar})::Cint
           @ccall libhighs.Highs_setDoubleOptionValue(highs::Ptr{Cvoid}, "time_limit"::Ptr{Cchar}, 20.0::Cdouble)::Cint
           callback_cfn = @cfunction(
               cb, Cvoid, (Cint, Ptr{Cchar}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
           )
           @ccall libhighs.Highs_setCallback(highs::Ptr{Cvoid}, callback_cfn::Ptr{Cvoid}, C_NULL::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_startCallback(highs::Ptr{Cvoid}, 1::Cint)::Cint
           @ccall libhighs.Highs_run(highs::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_destroy(highs::Ptr{Cvoid})::Cvoid
           return
       end
main (generic function with 1 method)

julia> main()
Running HiGHS 1.10.0 (git hash: fd8665394e): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0203s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
      55162     3.0925197821e+11 Pr: 127928(8.39614e+09); Du: 0(1.53652e-05) 11s
     106412     3.4606747253e+11 Pr: 108822(5.31543e+09); Du: 0(1.27265e-05) 16s
     135864     4.1239640308e+11 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 135864
Objective value     :  4.1212100887e+11
HiGHS run time      :         20.23

(hgh2) pkg> st
Status `/private/tmp/hgh2/Project.toml`
⌃ [8fd58aa0] HiGHS_jll v1.10.0+0
Info Packages marked with ⌃ have new versions available and may be upgradable.

Bad: [email protected] from Julia

julia> import HiGHS_jll: libhighs

julia> cb(::Cint, ::Ptr{Cchar}, ::Ptr{Cvoid}, ::Ptr{Cvoid}, ::Ptr{Cvoid}) = nothing
cb (generic function with 1 method)

julia> function main()
           highs = @ccall libhighs.Highs_create()::Ptr{Cvoid}
           @ccall libhighs.Highs_readModel(highs::Ptr{Cvoid}, "debug_model.mps"::Ptr{Cchar})::Cint
           @ccall libhighs.Highs_setDoubleOptionValue(highs::Ptr{Cvoid}, "time_limit"::Ptr{Cchar}, 20.0::Cdouble)::Cint
           callback_cfn = @cfunction(
               cb, Cvoid, (Cint, Ptr{Cchar}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
           )
           @ccall libhighs.Highs_setCallback(highs::Ptr{Cvoid}, callback_cfn::Ptr{Cvoid}, C_NULL::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_startCallback(highs::Ptr{Cvoid}, 1::Cint)::Cint
           @ccall libhighs.Highs_run(highs::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_destroy(highs::Ptr{Cvoid})::Cvoid
           return
       end
main (generic function with 1 method)

julia> main()
Running HiGHS 1.11.0 (git hash: 364c83a51e): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0559s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
       3513    -3.1200464951e+02 Ph1: 30668(8.63998e+07); Du: 162(312.005) 13s
       6293    -3.1200465025e+02 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 6293
Objective value     :  3.1185084999e+11
HiGHS run time      :         20.10

(hgh3) pkg> st
Status `/private/tmp/hgh3/Project.toml`
  [8fd58aa0] HiGHS_jll v1.11.0+1

Good: local binary from C

#include "interfaces/highs_c_api.h"

#include <stdio.h>
#include <stdlib.h>

void callback_fn(
    int callback_type,
    const char* message,
    const HighsCallbackDataOut* data_out,
    HighsCallbackDataIn* data_in,
    void* user_callback_data) {
    return;
}

int main(int argc, char *argv[]) {
    void* highs = Highs_create();
    int ret;
    ret = Highs_readModel(highs, "/tmp/debug_model.mps");
    ret = Highs_setDoubleOptionValue(highs, "time_limit", 20.0);
    ret = Highs_setCallback(highs, callback_fn, NULL);
    ret = Highs_startCallback(highs, kHighsCallbackSimplexInterrupt);
    ret = Highs_run(highs);
    Highs_destroy(highs);
    return 0;
}
Running HiGHS 1.11.0 (git hash: 364c83a51): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0161s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
      58880     3.0925275084e+11 Pr: 126319(7.25565e+09); Du: 0(1.55167e-05) 11s
     113736     3.5129678624e+11 Pr: 106122(4.19701e+09); Du: 0(1.2555e-05) 16s
     155936     4.1344772946e+11 Pr: 95429(5.31857e+09); Du: 0(1.13538e-05) 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 155936
Objective value     :  4.1317208318e+11
HiGHS run time      :         20.13

Good: local binary from Julia

julia> const libhighs = "/Users/Oscar/Documents/Code/HiGHS/build/lib/libhighs.dylib"
"/Users/Oscar/Documents/Code/HiGHS/build/lib/libhighs.dylib"

julia> cb(::Cint, ::Ptr{Cchar}, ::Ptr{Cvoid}, ::Ptr{Cvoid}, ::Ptr{Cvoid}) = nothing
cb (generic function with 1 method)

julia> function main()
           highs = @ccall libhighs.Highs_create()::Ptr{Cvoid}
           @ccall libhighs.Highs_readModel(highs::Ptr{Cvoid}, "debug_model.mps"::Ptr{Cchar})::Cint
           @ccall libhighs.Highs_setDoubleOptionValue(highs::Ptr{Cvoid}, "time_limit"::Ptr{Cchar}, 20.0::Cdouble)::Cint
           callback_cfn = @cfunction(
               cb, Cvoid, (Cint, Ptr{Cchar}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
           )
           @ccall libhighs.Highs_setCallback(highs::Ptr{Cvoid}, callback_cfn::Ptr{Cvoid}, C_NULL::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_startCallback(highs::Ptr{Cvoid}, 1::Cint)::Cint
           @ccall libhighs.Highs_run(highs::Ptr{Cvoid})::Cint
           @ccall libhighs.Highs_destroy(highs::Ptr{Cvoid})::Cvoid
           return
       end
main (generic function with 1 method)

julia> main()
Running HiGHS 1.11.0 (git hash: 364c83a51): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0163s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
      58880     3.0925275084e+11 Pr: 126319(7.25565e+09); Du: 0(1.55167e-05) 11s
     113736     3.5129678624e+11 Pr: 106122(4.19701e+09); Du: 0(1.2555e-05) 16s
     155711     4.1344768840e+11 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 155711
Objective value     :  4.1317204482e+11
HiGHS run time      :         20.10

Good: HiGHS_jll1.10 from C

(base) oscar@MacBookPro /tmp % export highs_jll=/Users/oscar/.julia/artifacts/89428fb6f1d99453f0a72cb77e5dd98a58e6545b
(base) oscar@MacBookPro /tmp % clang /tmp/main.c -o main -I$highs_jll/include/highs -L$highs_jll/lib -lhighs
(base) oscar@MacBookPro /tmp % export DYLD_LIBRARY_PATH=$highs_jll/lib; ./main
Running HiGHS 1.10.0 (git hash: fd8665394e): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  2s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.018s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 5s
      58880     3.0925275084e+11 Pr: 126319(7.25565e+09); Du: 0(1.55167e-05) 11s
     113736     3.5129678624e+11 Pr: 106122(4.19701e+09); Du: 0(1.2555e-05) 16s
     148404     4.1243099021e+11 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 148404
Objective value     :  4.1215531406e+11
HiGHS run time      :         20.13

Bad: [email protected] from C

(base) oscar@MacBookPro /tmp % export highs_jll=/Users/oscar/.julia/artifacts/d477d8295f6b5a3e10c379e2f891a18eace18e2b
(base) oscar@MacBookPro /tmp % clang /tmp/main.c -o main -I$highs_jll/include/highs -L$highs_jll/lib -lhighs
(base) oscar@MacBookPro /tmp % export DYLD_LIBRARY_PATH=$highs_jll/lib; ./main
Running HiGHS 1.11.0 (git hash: 364c83a51e): Copyright (c) 2025 HiGHS under MIT licence terms
Number of PL entries in BOUNDS section is 1738
LP   debug_model has 991849 rows; 1097468 cols; 3829286 nonzeros
Coefficient ranges:
  Matrix [1e-05, 5e+03]
  Cost   [1e-02, 3e+06]
  Bound  [1e-04, 2e+07]
  RHS    [3e-02, 9e+06]
Presolving model
876086 rows, 961701 cols, 3427018 nonzeros  1s
543434 rows, 898127 cols, 2722964 nonzeros  3s
Dependent equations search running on 49964 equations with time limit of 1.00s
Dependent equations search terminated after 0.0173s due to expected time exceeding limit
543247 rows, 897880 cols, 2701268 nonzeros  4s
Presolve : Reductions: rows 543247(-448602); columns 897880(-199588); elements 2701268(-1128018)
Solving the presolved LP
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.1200465363e+02 Ph1: 33076(4.31857e+08); Du: 162(312.005) 6s
       3513    -3.1200464951e+02 Ph1: 30668(8.63998e+07); Du: 162(312.005) 13s
       5384    -3.1200465066e+02 Ph1: 22924(2.67458e+07); Du: 162(312.005) 18s
       5947    -3.1200465041e+02 20s
Model name          : debug_model
Model status        : Time limit reached
Simplex   iterations: 5947
Objective value     :  3.1185084999e+11
HiGHS run time      :         20.10

odow avatar Jul 16 '25 03:07 odow

So if the build settings on Yggdrasil have not changed, is there any course of action? Trigger a rebuild and hope for the best?

jhmenke avatar Jul 17 '25 09:07 jhmenke

Trigger a rebuild and hope for the best?

Not likely. This might be a compiler optimization that is not in the Yggdrasil build but is locally. It's suspicious that the callback changes are in the diff, but that might not be the direct cause.

odow avatar Jul 17 '25 22:07 odow

Thank you very much, @odow ! With 1.18.2, we are back at original solving times!

jhmenke avatar Jul 23 '25 09:07 jhmenke

Should this issue be closed? I see on 1.18.2 release notes it is labeled as closed.

KSepetanc avatar Aug 06 '25 19:08 KSepetanc

I "fixed" this by disabling the simplex interrupt callback. We didn't fix the underlying issue.

odow avatar Aug 06 '25 21:08 odow