Fixed Bug with Upper Bound in PlasmoBenders#40
Merged
dlcole3 merged 5 commits intoMay 7, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets issue #39 by changing how PlasmoBenders constructs the forward-pass upper bound under parallel solves: instead of incrementally mutating a shared ub during per-subproblem solves, it records per-subproblem objective contributions and aggregates them after the forward pass completes.
Changes:
- Added
subgraph_objectivesstorage toBendersAlgorithmto record each subproblem’s objective contribution. - Refactored forward-pass code paths (threaded, async remote, and sequential) to populate
subgraph_objectivesand compute the UB via a final summation step. - Updated the regularization path to record objective contributions via
subgraph_objectives, and bumpedPlasmoBendersversion to0.3.2.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
lib/PlasmoBenders/src/solution.jl |
Refactors forward-pass iterations to avoid shared UB mutation; aggregates UB at end using stored per-subproblem objectives. |
lib/PlasmoBenders/src/regularize.jl |
Updates regularization pass to store per-object objective contributions instead of directly mutating UB. |
lib/PlasmoBenders/src/Benders.jl |
Adds and initializes subgraph_objectives; updates forward pass to seed UB from stored root contribution. |
lib/PlasmoBenders/Project.toml |
Version bump to 0.3.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR addresses #39 where, when solving in parallel, the upper bound may not be updated correctly because multiple processors can try to access the memory at the same time. To addresss this, this PR adds an attribute to the
BendersAlgorithmobject calledsubgraph_objectiveswhich stores the last iteration's objective value (minus theta, if applicable). It then uses these to construct the upper bound after all the forward pass is complete. This avoids trying to access the same memory across parallel solves in the forward pass.