perf(ssins): batch reads to reduce peak mem - #2
Draft
rafrafavi wants to merge 4 commits into
Draft
Conversation
Add pytest for testing read_select before refactoring Includes testing of memusage Both peak memory test and integrity test are coupled to save runtime Should be decoupled when possible.
d3v-null
reviewed
Apr 4, 2025
rafrafavi
commented
Apr 8, 2025
| MAX_FILE = 60 # GB | ||
| MAX_MEM_FACTOR = MAX_MEM // MAX_FILE | ||
|
|
||
| args = Namespace(files=['/Users/raf/source/repos/mwa-demo/demo/data//1061312152/raw/1061312152.metafits', |
Contributor
Author
There was a problem hiding this comment.
TODO: use relative paths when test data is cemented.
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 PR adds support for batching pyuvdata reads in
read_rawto reduce peak memory usage in the module:Profiling has shown that peak memory usage can be up to x6 of the size of the
fitsfiles we are reading, which could cause out-of-memory conditions on the target platform.Further profiling within
pyuvdatashows that the mem usage is diffused in several areas, with no evident "low-hanging fruit".The solution for now is to batch the fit files such that the file size does not exceed one-sixth of the available memory to avoid a blowout.