Skip to content

Bugfix esplodeded fogi labels #488

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

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

coreyostrove
Copy link
Contributor

This PR fixes two bugs. The first was reported here: #486, and was related to the parameter label management when using parameter interposers. Previously the behavior in the OpModel method _rebuild_paramvec resulted in the model's parameter label vector being set to the output of _ops_paramlbls_to_model_paramlbls. What would happen though is that on subsequent calls to _rebuild_paramvec that same output would get passed through the same method (growing larger in size each time) until the size of the labels exploded and memory ran out. The changes the behavior of the parameter label management and makes it so that the value of the internal _paramlbls vector is always that of the operations (modulo any parameter collection). When querying the value of the parameter_labels property for OpModel we now call _ops_paramlbls_to_model_paramlbls on the fly and return that value, so to the end-user they should see the same thing they are used to (but there may still be edge cases).

Unrelated to that bug, in the same context where the bug above arose I ran into another related to json serializing GSTGaugeOptSuite objects when the 'none' gauge optimization suite option was used, which should be fixed with this patch.

Corey Ostrove added 2 commits September 18, 2024 21:02
A bug in the parameter label handling code was causing parameter labels to explode exponentially in size when _rebuild_paramvec was caused, leading to major memory issues. This now makes it so that the value of _paramlbls is fixed to that of the underlying operations and adds a new version of the parameter_labels property that goes through the interposer (making the interposer labels something generated on demand). Also add a threshold for coefficients printing in the LinearInterposer to avoid obnoxious labels.
Serialization wasn't working correctly for GSTGaugeOptSuite with the trivial gauge optimization argument dict. This should fix that bug.
@coreyostrove coreyostrove added this to the 0.9.13 milestone Sep 19, 2024
@coreyostrove coreyostrove self-assigned this Sep 19, 2024
@coreyostrove coreyostrove requested review from a team as code owners September 19, 2024 03:53
@sserita sserita merged commit 74648a6 into develop Sep 19, 2024
0 of 4 checks passed
@sserita sserita deleted the bugfix-esplodeded-fogi-labels branch September 19, 2024 18:01
sserita added a commit that referenced this pull request Sep 19, 2024
Performing this pre-PR merge since this could have potentially
conflicted with fixes from #488 for parameter_labels
and #489 for IS_SIMPLE.
sserita added a commit that referenced this pull request Sep 19, 2024
rileyjmurray pushed a commit that referenced this pull request Sep 24, 2024
rileyjmurray pushed a commit that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants