[docs] add a work-around for multithreading with Gurobi#890
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #890 +/- ##
==========================================
+ Coverage 96.32% 96.35% +0.02%
==========================================
Files 28 28
Lines 4032 4032
==========================================
+ Hits 3884 3885 +1
+ Misses 148 147 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's pretty simple in the end, but it took me a long time to think of this! You're limited by
nthreads <= min(number of nodes, number of licenses)but that seems fine.Depending on how you partition the nodes, there might also be a lot of lock contention. It isn't obvious to me whether
1:n/2, n/2+1:nor1:2:n, 2:2:nis better. It kind of depends on the model. But in the worst case, they cannot be worse than single threaded.The alternative was much more complicated. We needed to create an explicit environment for each thread, and move the subproblems between environments depending on which thread was being run. That should have the same thread contention as the current algorithm, except that there would be overhead moving the models around and it isn't obvious how to do that through SDDP/JuMP/MOI/Gurobi.jl.
This approach is much simpler, and it doesn't even need any changes inside SDDP.jl.
x-ref #859 (comment)
and my discussion with Simran