-
Notifications
You must be signed in to change notification settings - Fork 180
JP-3776: Improve AmiAnalyze memory usage #9442
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
Conversation
|
regression tests started here https://github.com/spacetelescope/RegressionTests/actions/runs/14893626000 edit: Single failure was from JP-3941 and is not related |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9442 +/- ##
=======================================
Coverage 77.85% 77.85%
=======================================
Files 362 362
Lines 36287 36287
=======================================
Hits 28252 28252
Misses 8035 8035 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
drlaw1558
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG2M; confirmed with some 1600-integration AMI data that the peak memory usage drops from 27 GB to < 1 GB. Output data look to be unchanged, as is the runtime.
melanieclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sensible to me. It needs rebasing, and we should run the regtests again. They should now show the memory improvements, since #9433 was merged, right?
Do you want to wait for Rachel to review?
I don't think it's necessary to do so. There are a few "API changes" if someone were using these classes outside the pipeline, but my understanding from my last conversations with Rachel is that, while the team wants to maintain the flexibility of these classes for testing (i.e., don't just remove everything not used by pipeline) they don't have any active/established workflows that require these. And the refactor doesn't remove any information that isn't accessible via a straightforward workaround. If it turns out they're unhappy with the changes we'd hear about it in testing anyway. |
|
regression tests are clean. The memory usage tracker shows |
Resolves JP-3776
Closes #8860
This PR refactors the
AmiAnalyzestep to avoid creating a long list of 3-D arrays, reducing memory usage by a factor of ~13 for my test dataset (jw01349-c1007_20250319t131303_ami3_00002_asn.json). See ticket for memory usage flamegraphs - the one for this PR branch is namedmemray-flamegraph-output_refactor.html.A beneficial side-effect of this refactor is that it removes a code pattern in which
RawOifitsobjects requiredFringeFitterobject as input, but some methods ofFringeFitterrequired aRawOifitsthat was being initialized with that very sameFringeFitterobject, i.e.RawOifits(self). Now both classes require only an instrument data object, which I feel makes more logical sense and more cleanly splits up the roles ofRawOifitsandFringeFitter.Memory usage tests to prevent a regression will be added by #9433
Tasks
Build 12.0(use the latest build if not sure)no-changelog-entry-needed)changes/:echo "changed something" > changes/<PR#>.<changetype>.rst(see changelog readme for instructions)docs/pageokify_regteststo update the truth files