Add modelinstance support #983
Draft
Wegatriespython wants to merge 3 commits intomainfrom
Draft
Conversation
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #983 +/- ##
=======================================
- Coverage 96.4% 96.4% -0.1%
=======================================
Files 60 60
Lines 5135 5140 +5
=======================================
+ Hits 4954 4955 +1
- Misses 181 185 +4
|
Member
|
Same as iiasa/ixmp#605 (comment), I'd like to make sure that we don't create incompatibilities in our stack by having one official |
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 is an experimental branch connected to IXMP PR adds support for the Gamsmodelinstance APIwhich provides a persistent model object for use.
Right now this is quite experimental, hence the code is not up to quality. The API for allowing user access is also not final. Putting it here for reference and feedback. For most models, model generation times dominate solving times. This means when a sequence of scenarios are to be evaluated in an ensemble a large fraction of the time is spent in the generation of the model matrix. Modelinstance provides a persistent object with an in-memory database for modifiable parameters via sync_db.
In theory this allows for gains = 1 + time_build/time_solving. For the baseline model time_build is ~500s and solve is 200s which yields a gain of 3.5X for large number of runs. Additionally the model instance passes the previous solution's basis to the next solution. In theory then a barrier followed by Simplex methods with advanced basis can approach even higher performance gains. But this requires dynamic solver parametrization maybe ML methods could help here.
How to review
At this point feedback and usage would be appreciated
PR checklist
Experimental so this will not apply till at least an early Alpha stage is reached.
- [ ] Continuous integration checks all ✅- [ ] Add or expand tests; coverage checks both ✅- [ ] Add, expand, or update documentation.- [ ] Update release notes.