-
Notifications
You must be signed in to change notification settings - Fork 88
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
Gurobi backend interface #551
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
==========================================
+ Coverage 95.85% 96.56% +0.70%
==========================================
Files 24 25 +1
Lines 3619 3900 +281
Branches 788 771 -17
==========================================
+ Hits 3469 3766 +297
+ Misses 86 76 -10
+ Partials 64 58 -6
|
I have added tests, but we don't have gurobipy installed in the CI builds so those tests are being skipped. Hence the massive coverage drop. |
db4d420
to
4ff46d0
Compare
I have run the urban scale model for a full year using the pyomo (with gurobi solver) and gurobi interfaces and get the attached results. Headline: Gurobi interface peaks at ~30% less memory than pyomo. gurobi run: import calliope
calliope.set_log_verbosity("info")
m = calliope.examples.urban_scale(time_subset=None)
m.build(backend="gurobi")
m.solve(solver_options={"Threads": 1}) pyomo run: import calliope
calliope.set_log_verbosity("info")
m = calliope.examples.urban_scale(time_subset=None)
m.build(backend="pyomo")
m.solve(
solver="gurobi", solver_options={"Threads": 1}) Profiling using memray and setting [out] and [runfile] separately for pyomo and gurobi runs: memray run --trace-python-allocators -o [out].bin [runfile].py
memray flamegraph [out].bin -o [out].html |
Last week's new pyomo release has caused an issue in one of our tests (see #597). I've pinned Pyomo upper bound to avoid this issue for now. |
Fixes #349
Summary of changes in this pull request:
gurobipy
interfaceHow to use:
gurobipy
into your calliope env:mamba install gurobi::gurobi
NOTE: without a license, one can only work with very small models. Our example models are already too big (maybe if run over ~2 timesteps it would work?).
Reviewer checklist: