mlcommons / GaNDLF

A generalizable application framework for segmentation, regression, and classification using PyTorch
https://gandlf.org
Apache License 2.0
163 stars 79 forks source link

Memory requirement spike for `gandlf_preprocess` #780

Open sarthakpati opened 9 months ago

sarthakpati commented 9 months ago

Describe the bug When gandlf_process is run (with normalize and crop_external_zero_plane as preprocessing parameters), the process runs fine for a validation csv with ~180 subjects, but fails with OOM error for training csv with ~800 subjects using the BraTS data.

To Reproduce

  1. Construct a CSV of ~180 BraTS subjects, and another with ~720 subjects (copy-pasting the same 180 cases with different subject IDs should reproduce the error).
  2. Construct a config (model and training parameters don't matter) but have this key for preprocessing:
    data_preprocessing:
    {
    'normalize_nonZero',
    'crop_external_zero_planes',
    }
    patch_sampler:
    {
    'type': 'label', 
    } 
  3. Run the gandlf_preprocess script for both these cases.
  4. See it pass for the one with ~180 cases and fail for ~720 cases. This is with 250G RAM.

Expected behavior It should run for both.

Screenshots N.A.

GaNDLF Version

0.0.18-dev

Desktop (please complete the following information): N.A.

Additional context Memory profiler (thanks @hasan7n): https://pypi.org/project/memory-profiler/

VukW commented 8 months ago

Is the corresponding BraTS data publicly available? Can you provide it also, please?

sarthakpati commented 8 months ago

You should be able to download the data here: https://www.synapse.org/brats

And this should be replicable even on the unit testing data [ref].

Do you think you can include the report from #806 into your fix as well (since both related to memory consumption)?

github-actions[bot] commented 6 months ago

Stale issue message

sarthakpati commented 6 months ago

This is still under investigation.

github-actions[bot] commented 4 months ago

Stale issue message

github-actions[bot] commented 2 months ago

Stale issue message

github-actions[bot] commented 4 hours ago

Stale issue message