nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
299 stars 132 forks source link

FIX: Inform *SynthStrip* about the desired intraop threads #1101

Closed oesteban closed 1 year ago

oesteban commented 1 year ago

Necessary too for Nipype to execute resource management. This PR alleviates the problems of memory with SynthStrip by (1) setting a reasonable number of CPUs when operating in that mode [memory fingerprint drops as numpy is not so overeager]; and (2) permits nipype to execute resource management, ensuring there are not too many synthstrip instances operating at once.

As long as SynthStrip's model continues to be as large, and as long as pytorch does not implement all the layers in the model with half-precision, this is the best we can do at the moment.

Resolves #1004.

oesteban commented 1 year ago

Tested locally. Please reopen if you look at the code and some concern emerges.