Skip to content

Keep volumes in memory as float32 - #25

Merged
youssefassis merged 3 commits into
mainfrom
perf/lower-memory
Sep 29, 2026
Merged

youssefassis merged 3 commits into
mainfrom
perf/lower-memory

Conversation

@youssefassis

Copy link
Copy Markdown
Owner

Volumes are now read as float32 instead of nibabel's default float64. Since all training and validation patients stay in memory, this halves memory use: 150 MiB instead of 300 MiB for a 512×512×150 scan, about 16 GiB instead of 32.5 GiB for 111 patients. The model already received float32 patches, so its inputs are unchanged apart from rounding. Predictions are written as float32 too.

Code, tests and README note are in separate commits.

Volumes were loaded as float64 (nibabel's default) and all training
and validation patients stay in memory, e.g. 300 MiB per 512x512x150
scan and 32.5 GiB for 111 patients. Reading them as float32 halves
that, and the loading peak, without changing what the model receives
(patches were already converted to float32). Predictions are float32
too.
@youssefassis
youssefassis merged commit 7781d1e into main Sep 29, 2026
3 checks passed
@youssefassis
youssefassis deleted the perf/lower-memory branch September 30, 2026 05:42
youssefassis added a commit that referenced this pull request Sep 30, 2026
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.

1 participant