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

Possibly test HiGHS on RISC-V hardware #2000

Open
orlitzky opened this issue Oct 24, 2024 · 15 comments
Open

Possibly test HiGHS on RISC-V hardware #2000

orlitzky opened this issue Oct 24, 2024 · 15 comments
Assignees
Labels
enhancement New feature or request

Comments

@orlitzky
Copy link

As requested! But keep in mind that the difference was only important with GCC at -O2, or with clang, and on ARM64 or RISC-V hardware.

edge_disjoint_spanning_trees.lp.txt
edge_disjoint_spanning_trees.mps.txt

@jajhall
Copy link
Member

jajhall commented Oct 24, 2024

Sure. Are these compiler and architecture combinations that we support OK @galabovaa?

@jajhall
Copy link
Member

jajhall commented Oct 24, 2024

HiGHS solves the .lp (MPS) file in 2.09 (0.92) seconds, with a clearly different algorithmic path. Seeing that they correspond to a feasibility problem, different solutions are very likely.

Different machine, but undoubtedly rather faster than GLPK

@galabovaa
Copy link
Contributor

We have GCC and -O2 tested, as well as clang on ARM but we have not yet tested HiGHS on RISC-V hardware

@jajhall jajhall changed the title Example MIP from SageMath Possibly test HiGHS on RISC-V hardware Oct 25, 2024
@orlitzky
Copy link
Author

jajhall changed the title Example MIP from SageMath Possibly test HiGHS on RISC-V hardware

I'm in the middle of it :P

@orlitzky
Copy link
Author

Test project /home/mjo/src/HiGHS.git/build
        Start   1: capi_unit_tests
  1/150 Test   #1: capi_unit_tests ........................   Passed    0.18 sec
        Start   2: unit-test-build
  2/150 Test   #2: unit-test-build ........................   Passed    0.76 sec
        Start   3: unit_tests_all
  3/150 Test   #3: unit_tests_all .........................***Failed   43.85 sec
        Start   4: 25fv47--presolve=off
  4/150 Test   #4: 25fv47--presolve=off ...................***Failed  Required regular expression not found. Regex=[Simplex   iterations: 3149
Objective value     :  5.5018458883
]  0.93 sec
        Start   5: 25fv47--presolve=on
  5/150 Test   #5: 25fv47--presolve=on ....................   Passed    0.80 sec
        Start   6: 25fv47--random_seed=1
  6/150 Test   #6: 25fv47--random_seed=1 ..................   Passed    0.85 sec
        Start   7: 25fv47--random_seed=2
  7/150 Test   #7: 25fv47--random_seed=2 ..................   Passed    0.80 sec
        Start   8: 25fv47--random_seed=3
  8/150 Test   #8: 25fv47--random_seed=3 ..................   Passed    0.85 sec
        Start   9: 80bau3b--presolve=off
  9/150 Test   #9: 80bau3b--presolve=off ..................***Failed  Required regular expression not found. Regex=[Simplex   iterations: 3686
Objective value     :  9.8722419241
]  0.85 sec
        Start  10: 80bau3b--presolve=on
 10/150 Test  #10: 80bau3b--presolve=on ...................   Passed    0.87 sec
        Start  11: 80bau3b--random_seed=1
 11/150 Test  #11: 80bau3b--random_seed=1 .................   Passed    0.88 sec
        Start  12: 80bau3b--random_seed=2
 12/150 Test  #12: 80bau3b--random_seed=2 .................   Passed    0.93 sec
        Start  13: 80bau3b--random_seed=3
 13/150 Test  #13: 80bau3b--random_seed=3 .................   Passed    0.87 sec
        Start  14: adlittle--presolve=off
 14/150 Test  #14: adlittle--presolve=off .................   Passed    0.04 sec
        Start  15: adlittle--presolve=on
 15/150 Test  #15: adlittle--presolve=on ..................   Passed    0.05 sec
        Start  16: adlittle--random_seed=1
 16/150 Test  #16: adlittle--random_seed=1 ................   Passed    0.05 sec
        Start  17: adlittle--random_seed=2
 17/150 Test  #17: adlittle--random_seed=2 ................   Passed    0.05 sec
        Start  18: adlittle--random_seed=3
 18/150 Test  #18: adlittle--random_seed=3 ................   Passed    0.05 sec
        Start  19: afiro--presolve=off
 19/150 Test  #19: afiro--presolve=off ....................   Passed    0.03 sec
        Start  20: afiro--presolve=on
 20/150 Test  #20: afiro--presolve=on .....................   Passed    0.03 sec
        Start  21: afiro--random_seed=1
 21/150 Test  #21: afiro--random_seed=1 ...................   Passed    0.03 sec
        Start  22: afiro--random_seed=2
 22/150 Test  #22: afiro--random_seed=2 ...................   Passed    0.03 sec
        Start  23: afiro--random_seed=3
 23/150 Test  #23: afiro--random_seed=3 ...................   Passed    0.03 sec
        Start  24: etamacro--presolve=off
 24/150 Test  #24: etamacro--presolve=off .................***Failed  Required regular expression not found. Regex=[Simplex   iterations: 532
Objective value     : -7.5571523330
]  0.11 sec
        Start  25: etamacro--presolve=on
 25/150 Test  #25: etamacro--presolve=on ..................   Passed    0.12 sec
        Start  26: etamacro--random_seed=1
 26/150 Test  #26: etamacro--random_seed=1 ................   Passed    0.12 sec
        Start  27: etamacro--random_seed=2
 27/150 Test  #27: etamacro--random_seed=2 ................   Passed    0.12 sec
        Start  28: etamacro--random_seed=3
 28/150 Test  #28: etamacro--random_seed=3 ................   Passed    0.13 sec
        Start  29: greenbea--presolve=off
 29/150 Test  #29: greenbea--presolve=off .................***Failed  Required regular expression not found. Regex=[Simplex   iterations: 5109
Objective value     : -7.2555248130
]  3.24 sec
        Start  30: greenbea--presolve=on
 30/150 Test  #30: greenbea--presolve=on ..................   Passed    1.32 sec
        Start  31: greenbea--random_seed=1
 31/150 Test  #31: greenbea--random_seed=1 ................   Passed    1.24 sec
        Start  32: greenbea--random_seed=2
 32/150 Test  #32: greenbea--random_seed=2 ................   Passed    1.38 sec
        Start  33: greenbea--random_seed=3
 33/150 Test  #33: greenbea--random_seed=3 ................   Passed    1.33 sec
        Start  34: shell--presolve=off
 34/150 Test  #34: shell--presolve=off ....................   Passed    0.10 sec
        Start  35: shell--presolve=on
 35/150 Test  #35: shell--presolve=on .....................   Passed    0.15 sec
        Start  36: shell--random_seed=1
 36/150 Test  #36: shell--random_seed=1 ...................   Passed    0.15 sec
        Start  37: shell--random_seed=2
 37/150 Test  #37: shell--random_seed=2 ...................   Passed    0.15 sec
        Start  38: shell--random_seed=3
 38/150 Test  #38: shell--random_seed=3 ...................   Passed    0.15 sec
        Start  39: stair--presolve=off
 39/150 Test  #39: stair--presolve=off ....................***Failed  Required regular expression not found. Regex=[Simplex   iterations: 529
Objective value     : -2.5126695119
]  0.16 sec
        Start  40: stair--presolve=on
 40/150 Test  #40: stair--presolve=on .....................   Passed    0.15 sec
        Start  41: stair--random_seed=1
 41/150 Test  #41: stair--random_seed=1 ...................   Passed    0.15 sec
        Start  42: stair--random_seed=2
 42/150 Test  #42: stair--random_seed=2 ...................   Passed    0.15 sec
        Start  43: stair--random_seed=3
 43/150 Test  #43: stair--random_seed=3 ...................   Passed    0.15 sec
        Start  44: standata--presolve=off
 44/150 Test  #44: standata--presolve=off .................   Passed    0.06 sec
        Start  45: standata--presolve=on
 45/150 Test  #45: standata--presolve=on ..................   Passed    0.09 sec
        Start  46: standata--random_seed=1
 46/150 Test  #46: standata--random_seed=1 ................   Passed    0.09 sec
        Start  47: standata--random_seed=2
 47/150 Test  #47: standata--random_seed=2 ................   Passed    0.09 sec
        Start  48: standata--random_seed=3
 48/150 Test  #48: standata--random_seed=3 ................   Passed    0.09 sec
        Start  49: standgub--presolve=off
 49/150 Test  #49: standgub--presolve=off .................   Passed    0.07 sec
        Start  50: standgub--presolve=on
 50/150 Test  #50: standgub--presolve=on ..................   Passed    0.09 sec
        Start  51: standgub--random_seed=1
 51/150 Test  #51: standgub--random_seed=1 ................   Passed    0.10 sec
        Start  52: standgub--random_seed=2
 52/150 Test  #52: standgub--random_seed=2 ................   Passed    0.10 sec
        Start  53: standgub--random_seed=3
 53/150 Test  #53: standgub--random_seed=3 ................   Passed    0.09 sec
        Start  54: standmps--presolve=off
 54/150 Test  #54: standmps--presolve=off .................   Passed    0.08 sec
        Start  55: standmps--presolve=on
 55/150 Test  #55: standmps--presolve=on ..................   Passed    0.11 sec
        Start  56: standmps--random_seed=1
 56/150 Test  #56: standmps--random_seed=1 ................   Passed    0.11 sec
        Start  57: standmps--random_seed=2
 57/150 Test  #57: standmps--random_seed=2 ................   Passed    0.11 sec
        Start  58: standmps--random_seed=3
 58/150 Test  #58: standmps--random_seed=3 ................   Passed    0.11 sec
        Start  59: bgetam--presolve=off
 59/150 Test  #59: bgetam--presolve=off ...................   Passed    0.06 sec
        Start  60: bgetam--presolve=on
 60/150 Test  #60: bgetam--presolve=on ....................   Passed    0.08 sec
        Start  61: bgetam--random_seed=1
 61/150 Test  #61: bgetam--random_seed=1 ..................   Passed    0.08 sec
        Start  62: bgetam--random_seed=2
 62/150 Test  #62: bgetam--random_seed=2 ..................   Passed    0.08 sec
        Start  63: bgetam--random_seed=3
 63/150 Test  #63: bgetam--random_seed=3 ..................   Passed    0.08 sec
        Start  64: box1--presolve=off
 64/150 Test  #64: box1--presolve=off .....................   Passed    0.04 sec
        Start  65: box1--presolve=on
 65/150 Test  #65: box1--presolve=on ......................   Passed    0.05 sec
        Start  66: box1--random_seed=1
 66/150 Test  #66: box1--random_seed=1 ....................   Passed    0.05 sec
        Start  67: box1--random_seed=2
 67/150 Test  #67: box1--random_seed=2 ....................   Passed    0.05 sec
        Start  68: box1--random_seed=3
 68/150 Test  #68: box1--random_seed=3 ....................   Passed    0.05 sec
        Start  69: ex72a--presolve=off
 69/150 Test  #69: ex72a--presolve=off ....................   Passed    0.05 sec
        Start  70: ex72a--presolve=on
 70/150 Test  #70: ex72a--presolve=on .....................   Passed    0.04 sec
        Start  71: ex72a--random_seed=1
 71/150 Test  #71: ex72a--random_seed=1 ...................   Passed    0.04 sec
        Start  72: ex72a--random_seed=2
 72/150 Test  #72: ex72a--random_seed=2 ...................   Passed    0.04 sec
        Start  73: ex72a--random_seed=3
 73/150 Test  #73: ex72a--random_seed=3 ...................   Passed    0.04 sec
        Start  74: forest6--presolve=off
 74/150 Test  #74: forest6--presolve=off ..................   Passed    0.04 sec
        Start  75: forest6--presolve=on
 75/150 Test  #75: forest6--presolve=on ...................   Passed    0.05 sec
        Start  76: forest6--random_seed=1
 76/150 Test  #76: forest6--random_seed=1 .................   Passed    0.05 sec
        Start  77: forest6--random_seed=2
 77/150 Test  #77: forest6--random_seed=2 .................   Passed    0.04 sec
        Start  78: forest6--random_seed=3
 78/150 Test  #78: forest6--random_seed=3 .................   Passed    0.05 sec
        Start  79: galenet--presolve=off
 79/150 Test  #79: galenet--presolve=off ..................   Passed    0.03 sec
        Start  80: galenet--presolve=on
 80/150 Test  #80: galenet--presolve=on ...................   Passed    0.03 sec
        Start  81: galenet--random_seed=1
 81/150 Test  #81: galenet--random_seed=1 .................   Passed    0.03 sec
        Start  82: galenet--random_seed=2
 82/150 Test  #82: galenet--random_seed=2 .................   Passed    0.03 sec
        Start  83: galenet--random_seed=3
 83/150 Test  #83: galenet--random_seed=3 .................   Passed    0.03 sec
        Start  84: gams10am--presolve=off
 84/150 Test  #84: gams10am--presolve=off .................   Passed    0.04 sec
        Start  85: gams10am--presolve=on
 85/150 Test  #85: gams10am--presolve=on ..................   Passed    0.03 sec
        Start  86: gams10am--random_seed=1
 86/150 Test  #86: gams10am--random_seed=1 ................   Passed    0.03 sec
        Start  87: gams10am--random_seed=2
 87/150 Test  #87: gams10am--random_seed=2 ................   Passed    0.03 sec
        Start  88: gams10am--random_seed=3
 88/150 Test  #88: gams10am--random_seed=3 ................   Passed    0.03 sec
        Start  89: refinery--presolve=off
 89/150 Test  #89: refinery--presolve=off .................   Passed    0.08 sec
        Start  90: refinery--presolve=on
 90/150 Test  #90: refinery--presolve=on ..................   Passed    0.08 sec
        Start  91: refinery--random_seed=1
 91/150 Test  #91: refinery--random_seed=1 ................   Passed    0.08 sec
        Start  92: refinery--random_seed=2
 92/150 Test  #92: refinery--random_seed=2 ................   Passed    0.08 sec
        Start  93: refinery--random_seed=3
 93/150 Test  #93: refinery--random_seed=3 ................   Passed    0.08 sec
        Start  94: woodinfe--presolve=off
 94/150 Test  #94: woodinfe--presolve=off .................   Passed    0.03 sec
        Start  95: woodinfe--presolve=on
 95/150 Test  #95: woodinfe--presolve=on ..................   Passed    0.03 sec
        Start  96: woodinfe--random_seed=1
 96/150 Test  #96: woodinfe--random_seed=1 ................   Passed    0.03 sec
        Start  97: woodinfe--random_seed=2
 97/150 Test  #97: woodinfe--random_seed=2 ................   Passed    0.03 sec
        Start  98: woodinfe--random_seed=3
 98/150 Test  #98: woodinfe--random_seed=3 ................   Passed    0.03 sec
        Start  99: small_mip--presolve=off
 99/150 Test  #99: small_mip--presolve=off ................   Passed    0.04 sec
        Start 100: small_mip--presolve=on
100/150 Test #100: small_mip--presolve=on .................   Passed    0.03 sec
        Start 101: small_mip--random_seed=1
101/150 Test #101: small_mip--random_seed=1 ...............   Passed    0.03 sec
        Start 102: small_mip--random_seed=2
102/150 Test #102: small_mip--random_seed=2 ...............   Passed    0.03 sec
        Start 103: small_mip--random_seed=3
103/150 Test #103: small_mip--random_seed=3 ...............   Passed    0.03 sec
        Start 104: flugpl--presolve=off
104/150 Test #104: flugpl--presolve=off ...................   Passed    0.69 sec
        Start 105: flugpl--presolve=on
105/150 Test #105: flugpl--presolve=on ....................   Passed    1.03 sec
        Start 106: flugpl--random_seed=1
106/150 Test #106: flugpl--random_seed=1 ..................   Passed    0.87 sec
        Start 107: flugpl--random_seed=2
107/150 Test #107: flugpl--random_seed=2 ..................   Passed    1.01 sec
        Start 108: flugpl--random_seed=3
108/150 Test #108: flugpl--random_seed=3 ..................   Passed    1.10 sec
        Start 109: lseu--presolve=off
109/150 Test #109: lseu--presolve=off .....................   Passed    1.29 sec
        Start 110: lseu--presolve=on
110/150 Test #110: lseu--presolve=on ......................   Passed    3.29 sec
        Start 111: lseu--random_seed=1
111/150 Test #111: lseu--random_seed=1 ....................   Passed    4.88 sec
        Start 112: lseu--random_seed=2
112/150 Test #112: lseu--random_seed=2 ....................   Passed    3.79 sec
        Start 113: lseu--random_seed=3
113/150 Test #113: lseu--random_seed=3 ....................   Passed    2.80 sec
        Start 114: egout--presolve=off
114/150 Test #114: egout--presolve=off ....................   Passed    0.15 sec
        Start 115: egout--presolve=on
115/150 Test #115: egout--presolve=on .....................   Passed    0.12 sec
        Start 116: egout--random_seed=1
116/150 Test #116: egout--random_seed=1 ...................   Passed    0.12 sec
        Start 117: egout--random_seed=2
117/150 Test #117: egout--random_seed=2 ...................   Passed    0.12 sec
        Start 118: egout--random_seed=3
118/150 Test #118: egout--random_seed=3 ...................   Passed    0.12 sec
        Start 119: gt2--presolve=off
119/150 Test #119: gt2--presolve=off ......................   Passed    0.44 sec
        Start 120: gt2--presolve=on
120/150 Test #120: gt2--presolve=on .......................   Passed    0.57 sec
        Start 121: gt2--random_seed=1
121/150 Test #121: gt2--random_seed=1 .....................   Passed    0.78 sec
        Start 122: gt2--random_seed=2
122/150 Test #122: gt2--random_seed=2 .....................   Passed    0.37 sec
        Start 123: gt2--random_seed=3
123/150 Test #123: gt2--random_seed=3 .....................   Passed    0.39 sec
        Start 124: rgn--presolve=off
124/150 Test #124: rgn--presolve=off ......................   Passed    2.09 sec
        Start 125: rgn--presolve=on
125/150 Test #125: rgn--presolve=on .......................   Passed    2.05 sec
        Start 126: rgn--random_seed=1
126/150 Test #126: rgn--random_seed=1 .....................   Passed    1.68 sec
        Start 127: rgn--random_seed=2
127/150 Test #127: rgn--random_seed=2 .....................   Passed    1.94 sec
        Start 128: rgn--random_seed=3
128/150 Test #128: rgn--random_seed=3 .....................   Passed    2.16 sec
        Start 129: bell5--presolve=off
129/150 Test #129: bell5--presolve=off ....................   Passed    9.61 sec
        Start 130: bell5--presolve=on
130/150 Test #130: bell5--presolve=on .....................   Passed    8.96 sec
        Start 131: bell5--random_seed=1
131/150 Test #131: bell5--random_seed=1 ...................   Passed    6.33 sec
        Start 132: bell5--random_seed=2
132/150 Test #132: bell5--random_seed=2 ...................   Passed    7.59 sec
        Start 133: bell5--random_seed=3
133/150 Test #133: bell5--random_seed=3 ...................   Passed    6.46 sec
        Start 134: sp150x300d--presolve=off
134/150 Test #134: sp150x300d--presolve=off ...............   Passed    2.57 sec
        Start 135: sp150x300d--presolve=on
135/150 Test #135: sp150x300d--presolve=on ................   Passed    0.40 sec
        Start 136: sp150x300d--random_seed=1
136/150 Test #136: sp150x300d--random_seed=1 ..............   Passed    0.41 sec
        Start 137: sp150x300d--random_seed=2
137/150 Test #137: sp150x300d--random_seed=2 ..............   Passed    0.37 sec
        Start 138: sp150x300d--random_seed=3
138/150 Test #138: sp150x300d--random_seed=3 ..............   Passed    0.38 sec
        Start 139: p0548--presolve=off
139/150 Test #139: p0548--presolve=off ....................   Passed    0.77 sec
        Start 140: p0548--presolve=on
140/150 Test #140: p0548--presolve=on .....................   Passed    0.66 sec
        Start 141: p0548--random_seed=1
141/150 Test #141: p0548--random_seed=1 ...................   Passed    0.71 sec
        Start 142: p0548--random_seed=2
142/150 Test #142: p0548--random_seed=2 ...................   Passed    0.65 sec
        Start 143: p0548--random_seed=3
143/150 Test #143: p0548--random_seed=3 ...................   Passed    0.70 sec
        Start 144: dcmulti--presolve=off
144/150 Test #144: dcmulti--presolve=off ..................   Passed   15.91 sec
        Start 145: dcmulti--presolve=on
145/150 Test #145: dcmulti--presolve=on ...................   Passed    8.47 sec
        Start 146: dcmulti--random_seed=1
146/150 Test #146: dcmulti--random_seed=1 .................   Passed   11.02 sec
        Start 147: dcmulti--random_seed=2
147/150 Test #147: dcmulti--random_seed=2 .................   Passed   10.53 sec
        Start 148: dcmulti--random_seed=3
148/150 Test #148: dcmulti--random_seed=3 .................   Passed    6.31 sec
        Start 149: cxx_examples_call_highs_from_cpp
149/150 Test #149: cxx_examples_call_highs_from_cpp .......   Passed    0.04 sec
        Start 150: c_examples_call_highs_from_c_minimal
150/150 Test #150: c_examples_call_highs_from_c_minimal ...   Passed    0.07 sec

96% tests passed, 6 tests failed out of 150

Total Test time (real) = 201.84 sec

The following tests FAILED:
	 3 - unit_tests_all (Failed)
	 4 - 25fv47--presolve=off (Failed)
	 9 - 80bau3b--presolve=off (Failed)
	24 - etamacro--presolve=off (Failed)
	29 - greenbea--presolve=off (Failed)
	39 - stair--presolve=off (Failed)
Errors while running CTest

Let me see if I can find what went wrong.

@orlitzky
Copy link
Author

One looks like,

/home/mjo/src/HiGHS.git/check/TestLpSolvers.cpp:286: FAILED:
  REQUIRE( info.simplex_iteration_count == 472 )
with expansion:
  437 (0x1b5) == 472 (0x1d8)

But all the others are variations on this regex-not-found:

Running HiGHS 1.8.0 (git hash: fcfb534): Copyright (c) 2024 HiGHS under MIT licence \
terms
LP   25fv47 has 821 rows; 1571 cols; 10400 nonzeros
Coefficient ranges:
  Matrix [2e-04, 2e+02]
  Cost   [1e-03, 1e+02]
  Bound  [0e+00, 0e+00]
  RHS    [2e-01, 2e+03]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -8.6641744311e+01 Ph1: 79(245.084); Du: 41(86.6417) 0s
       3103     5.5018458883e+03 Pr: 0(0); Du: 0(5.15143e-14) 1s
Model   status      : Optimal
Simplex   iterations: 3103
Objective value     :  5.5018458883e+03
HiGHS run time      :          0.82
<end of output>
Test time =   0.93 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 3149
Objective value     :  5.5018458883
]
"25fv47--presolve=off" end time: Oct 25 07:27 EDT
"25fv47--presolve=off" time elapsed: 00:00:00
----------------------------------------------------------

@jajhall jajhall added the enhancement New feature or request label Oct 25, 2024
@jajhall
Copy link
Member

jajhall commented Oct 25, 2024

These iteration count tests are indicators of a logical difference in the way that the simplex solver runs on a particular architecture: no error has occurred.

They can be caused by compiler optimizations

@galabovaa
Copy link
Contributor

It is worth considering modifying our tests so the iteration counts are only checked on particular architectures that we have tested on. Since it is expected for them to differ.

I guess the objective values differ with a value below 1e-08.

For macOS arm I have added different objective values and iterations to ctest for the instances that differ, and the ones above seem to be a subset. In way what you show is expected.

Is it possible for you to run ctest --verbose and send me the (possibly rather large) output, so I could use the values to do the same?

@orlitzky
Copy link
Author

Is it possible for you to run ctest --verbose and send me the (possibly rather large) output, so I could use the values to do the same?

No problem, here you go:

ctest-verbose.log.zip

@galabovaa
Copy link
Contributor

Thank you! I will add the iteration counts for RICS-V in cmake :)

@galabovaa
Copy link
Contributor

Hi @orlitzky

I have added the iteration count modifications to branch risc-v:

https://github.com/ERGO-Code/HiGHS/tree/risc-v

Could you please check whether there are any tests that are still failing?

Once those are cleared I can merge it in latest.

@orlitzky
Copy link
Author

I admit I was trying to trick it, but I did succeed by switching to -O1 with gcc. Summary:

The following tests FAILED:
	 4 - 25fv47--presolve=off (Failed)
	 9 - 80bau3b--presolve=off (Failed)
	14 - etamacro--presolve=off (Failed)
	19 - greenbea--presolve=off (Failed)
	24 - stair--presolve=off (Failed)

Details:

Running HiGHS 1.8.0 (git hash: 7af271225): Copyright (c) 2024 HiGHS under MIT licence terms
LP   25fv47 has 821 rows; 1571 cols; 10400 nonzeros
Coefficient ranges:
  Matrix [2e-04, 2e+02]
  Cost   [1e-03, 1e+02]
  Bound  [0e+00, 0e+00]
  RHS    [2e-01, 2e+03]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -8.6641744311e+01 Ph1: 79(245.084); Du: 41(86.6417) 0s
       3149     5.5018458883e+03 Pr: 0(0); Du: 0(3.10862e-14) 1s
Model name          : 25fv47
Model status        : Optimal
Simplex   iterations: 3149
Objective value     :  5.5018458883e+03
Highs::reportSolvedLpQpStats Objective for 25fv47: primal =  5.5018458883e+03; dual =  5.5018458883e+03; rel gap =  1.8183791263e-15
HiGHS run time      :          0.91
<end of output>
Test time =   1.03 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 3103
Objective value     :  5.5018458883
]
"25fv47--presolve=off" end time: Oct 30 23:41 EDT
"25fv47--presolve=off" time elapsed: 00:00:01
Running HiGHS 1.8.0 (git hash: 7af271225): Copyright (c) 2024 HiGHS under MIT licence terms
LP   80bau3b has 2262 rows; 9799 cols; 21002 nonzeros
Coefficient ranges:
  Matrix [2e-04, 1e+02]
  Cost   [1e-03, 3e+03]
  Bound  [7e-05, 1e+06]
  RHS    [1e-03, 5e+03]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -3.4167145836e+02 Ph1: 101(295.75); Du: 208(341.671) 0s
       3686     9.8722419241e+05 Pr: 0(0); Du: 0(1.58429e-13) 1s
Model name          : 80bau3b
Model status        : Optimal
Simplex   iterations: 3686
Objective value     :  9.8722419241e+05
Highs::reportSolvedLpQpStats Objective for 80bau3b: primal =  9.8722419241e+05; dual =  9.8722419241e+05; rel gap =  5.8960934468e-16
HiGHS run time      :          0.65
<end of output>
Test time =   0.94 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 3705
Objective value     :  9.8722419241
]
"80bau3b--presolve=off" end time: Oct 30 23:41 EDT
"80bau3b--presolve=off" time elapsed: 00:00:00
Running HiGHS 1.8.0 (git hash: 7af271225): Copyright (c) 2024 HiGHS under MIT licence terms
LP   etamacro has 400 rows; 688 cols; 2409 nonzeros
Coefficient ranges:
  Matrix [2e-02, 2e+03]
  Cost   [8e-03, 8e+02]
  Bound  [3e-02, 1e+02]
  RHS    [1e+00, 1e+04]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -2.9562269393e+01 Ph1: 46(77.0946); Du: 45(29.5623) 0s
        530    -7.5571523130e+02 Pr: 0(0); Du: 0(1.87426e-07) 0s
        530    -7.5571523130e+02 Pr: 0(0); Du: 0(1.87426e-07) 0s
Using EKK primal simplex solver
  Iteration        Objective     Infeasibilities num(sum)
        530    -7.5571523130e+02 Pr: 0(0); Du: 1(1.46689e-06) 0s
        532    -7.5571523330e+02 Pr: 0(0); Du: 0(1.05135e-07) 0s
Model name          : etamacro
Model status        : Optimal
Simplex   iterations: 532
Objective value     : -7.5571523330e+02
Highs::reportSolvedLpQpStats Objective for etamacro: primal = -7.5571523330e+02; dual = -7.5571523330e+02; rel gap =  1.5043608057e-16
HiGHS run time      :          0.06
<end of output>
Test time =   0.12 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 531
Objective value     : -7.5571523330
]
"etamacro--presolve=off" end time: Oct 30 23:41 EDT
"etamacro--presolve=off" time elapsed: 00:00:00
Running HiGHS 1.8.0 (git hash: 7af271225): Copyright (c) 2024 HiGHS under MIT licence terms
LP   greenbea has 2392 rows; 5405 cols; 30877 nonzeros
Coefficient ranges:
  Matrix [6e-05, 1e+02]
  Cost   [6e-02, 1e+02]
  Bound  [1e+00, 1e+04]
  RHS    [0e+00, 0e+00]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -1.7539523835e+01 Ph1: 6(3.75); Du: 6(17.5395) 0s
       5109    -7.2555248130e+07 Pr: 0(0); Du: 0(1.01554e-11) 3s
       5109    -7.2555248130e+07 Pr: 0(0); Du: 0(1.01554e-11) 3s
Model name          : greenbea
Model status        : Optimal
Simplex   iterations: 5109
Objective value     : -7.2555248130e+07
Highs::reportSolvedLpQpStats Objective for greenbea: primal = -7.2555248130e+07; dual = -7.2555248130e+07; rel gap =  1.4376372633e-15
HiGHS run time      :          3.36
<end of output>
Test time =   3.62 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 5156
Objective value     : -7.2555248130
]
"greenbea--presolve=off" end time: Oct 30 23:41 EDT
"greenbea--presolve=off" time elapsed: 00:00:03
Running HiGHS 1.8.0 (git hash: 7af271225): Copyright (c) 2024 HiGHS under MIT licence terms
LP   stair has 356 rows; 467 cols; 3856 nonzeros
Coefficient ranges:
  Matrix [1e-05, 1e+01]
  Cost   [1e+00, 1e+00]
  Bound  [1e-01, 3e+02]
  RHS    [3e-02, 9e+01]
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -5.1199799154e+02 Ph1: 36(27170.7); Du: 1(511.998) 0s
        529    -2.5126695119e+02 Pr: 0(0) 0s
Model name          : stair
Model status        : Optimal
Simplex   iterations: 529
Objective value     : -2.5126695119e+02
Highs::reportSolvedLpQpStats Objective for stair: primal = -2.5126695119e+02; dual = -2.5126695119e+02; rel gap =  9.0490880063e-16
HiGHS run time      :          0.09
<end of output>
Test time =   0.15 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found. Regex=[Simplex   iterations: 531
Objective value     : -2.5126695119
]
"stair--presolve=off" end time: Oct 30 23:41 EDT
"stair--presolve=off" time elapsed: 00:00:00

@galabovaa
Copy link
Contributor

This trick is expected to work: changing levels of compiler optimizations is expected to change iteration counts. We've had a discusstion about it recently with some new compiler friends.

We only really test for the default -O2. So, apart from the trick, did ctest pass with the default setting? :)

@galabovaa
Copy link
Contributor

I suppose it may be worth to modify CMake, so the iteration count tests are only executed if the level of -O is not modified by the user. I would be happy to do this on another branch. This bit I could test locally too, since it would also fail on macos ARM / windows or linux with amd64 too.

@orlitzky
Copy link
Author

Yes, it worked with the same compiler/flags as in my original report.

Out of the box, CMake will actually use -O3 unless you override it. For example,

cd /home/mjo/src/HiGHS.git/build/src && /usr/lib/llvm/19/bin/clang++ -DNDEBUG -Dhighs_EXPORTS -I/home/mjo/src/HiGHS.git/src -I/home/mjo/src/HiGHS.git/build -I/home/mjo/src/HiGHS.git/extern -I/home/mjo/src/HiGHS.git/extern/filereader -I/home/mjo/src/HiGHS.git/extern/pdqsort -I/home/mjo/src/HiGHS.git/extern/zstr -I/home/mjo/src/HiGHS.git/src/interfaces -I/home/mjo/src/HiGHS.git/src/io -I/home/mjo/src/HiGHS.git/src/ipm -I/home/mjo/src/HiGHS.git/src/ipm/ipx -I/home/mjo/src/HiGHS.git/src/ipm/basiclu -I/home/mjo/src/HiGHS.git/src/lp_data -I/home/mjo/src/HiGHS.git/src/mip -I/home/mjo/src/HiGHS.git/src/model -I/home/mjo/src/HiGHS.git/src/parallel -I/home/mjo/src/HiGHS.git/src/pdlp -I/home/mjo/src/HiGHS.git/src/pdlp/cupdlp -I/home/mjo/src/HiGHS.git/src/presolve -I/home/mjo/src/HiGHS.git/src/qpsolver -I/home/mjo/src/HiGHS.git/src/simplex -I/home/mjo/src/HiGHS.git/src/test -I/home/mjo/src/HiGHS.git/src/util -O2 -pipe -mabi=lp64d -march=rv64gc -O3 -DNDEBUG -std=c++11 -flto=thin -fPIC -Wno-unused-variable -Wno-unused-const-variable -MD -MT src/CMakeFiles/highs.dir//extern/filereaderlp/reader.cpp.o -MF CMakeFiles/highs.dir//extern/filereaderlp/reader.cpp.o.d -o CMakeFiles/highs.dir/__/extern/filereaderlp/reader.cpp.o -c /home/mjo/src/HiGHS.git/extern/filereaderlp/reader.cpp

My CXXFLAGS are -O2 -pipe -mabi=lp64d -march=rv64gc but the rest (including -O3) were added by CMake, and the -O3 takes precedence because it comes later on the CLI.

IMO you're likely to run into the same sort of problem with changing CC/CXX as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants