Repository navigation
Conversation
|
@odow Promised ping, please have a look. |
Merging this PR will degrade performance by 14.68%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_to_lp[qp-n=1000] |
1.9 MB | 2.6 MB | -24.96% |
| ❌ | test_to_lp[nodal_balance_sparse-severity=50] |
2.8 MB | 3.7 MB | -24.08% |
| ❌ | test_to_lp[merge_balance-severity=0] |
2.7 MB | 3.3 MB | -18.24% |
| ⚡ | test_to_lp[nodal_balance-severity=0] |
3.7 MB | 3.3 MB | +13.77% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/plasmo-jl-benders (8ccbdbd) with master (718c0c1)
Footnotes
-
181 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
Yeah we should chat about this. |
Changes proposed in this Pull Request
Adds a new sub-packge
linopy.contrib.plasmoto run Benders or nested benders decompositions on linopy models.A partitioning algebra that is available through
linopy.contrib.plasmo.Partitionand a few small helpers allows splitting up a linopy model into named nodes based on its dimensions. Each nodes is subset of variables and constraints. Variable sets are typically overlapping, while constraint sets are disjunct. Within Python CSR matrices and variable bounds for each node are constructed, passed to helpers in a small julia module and constructed as individual subgraphs in a Plasmo.jl OptiGraph. A Benders or NestedBendersAlgorithm can then be used to solve the OptiGraph in Julia/JuMP.The result is retrieved as a Result object that can be assigned to the original Linopy model.
The contrib.plasmo code probably will eventually not live in linopy, but instead a small adjacent package. The experiment folder is a small example which should move to the docs (but without the dependencies).
Look at the
experiment/run_benders.pyfile or the commentedexperiment/plasmo-benders-decomposition.nbnotebook, both run benders decomposition on the small testProblem that was provided by @leonardgoeke through https://github.com/leonardgoeke/Linopy2Plasmo.jl , see also discussion in PyPSA/PyPSA#1712 .Dependencies
The interface depends on
juliacallandjuliapkgto set up a julia installation and an environment with the required Julia packages. They are set up automatically within the pixi environment in theexperimentfolder.Open issues
Checklist
AGENTS.md).doc.doc/release_notes.rstof the upcoming release is included.