-
Notifications
You must be signed in to change notification settings - Fork 14
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
Non-deterministic optimization model building #1143
Comments
There are a couple of places I think might cause this:
|
@joaquimg I also believe that these days we use parallel processing to build constraints, so I expect that can also cause changes in ordering etc. Can you confirm @manuelma ? If this potentially causes some variation in model solve time, is there any reason to expect that there is any net negative impact? @joaquimg are you aware of the write_model_file() function? This is likely a much better method for debugging models as you get constraint and variable names. |
I'm probably missing something but quickly looking at the model json file I found that mip_rel_gap is set to 0.50 which maybe means 50% gap? Could that be causing the difference in solution times? @DillonJ I don't see any reason why multithreading in building the constraints could lead to any issue regarding solve. |
@DillonJ right, I got that but thought you were asking about model solve time. So mutlithreading - as far as I can see - could be responsible for constraints being generated and possibly written to the mps in random order, but still it will always be the same model and thus solve time shouldn't be affected. I don't know what the solver does but I could imagine that the order of the rows in a matrix could result in differences in how difficult it is to fatorize it? No idea, just wild guessing... |
@DillonJ That is an interesting point about parallel model building. @manuelma , about your gap comment, I am generating the MPS files before calling the HiGHS solve routine so they are not affected by gap parameters. @DillonJ thanks fo the |
@joaquimg right, thank you for the clarification - I wasn't implying that the mip gap could have been affecting the MPS file, just the difference in solve times you were reporting. But that's also a guess. To clarify, we use |
Perfect. What I said about |
I am running the
main.jl
script in this PR jump-dev/open-energy-modeling-benchmarks#38Every time I run it, I get a different mps file.
Rows are certainly and non-deterministic order:
This might be due to many reasons:
Dict
(or some other collection that does not preserve ordering).OrderedDict
fromOrderedCollection
is slower for some operations but preserves the order.Even if the only issue is order, the models might have heavily varying solution times and might be difficult to debug.
Deterministic behavior would be ideal here.
The text was updated successfully, but these errors were encountered: