Patch data iteration during inference to enable GPU pre / post processing #7440
Replies: 2 comments
-
Hi @Thibault-Pelletier, thanks for your interest here.
We also have some plans to enhance the sliding_window_inference to improve the utilization efficiency of the GPU, but it's not on the agenda yet. |
Beta Was this translation helpful? Give feedback.
-
Hi @KumoLiu , Thanks for the feedback. What you are describing is already what we are doing. My use case is more on optimizing what is done before and after the inference and not the inference process itself and for one image inference only (after the training and validation). To take an example : If we have one volume as an input and we want to run the Whole Body CT inference on it, we would need to change the orientation and resample the volume before running a sliding windo inference on it. After the inference has run, we need to invert the previous resampling. If the whole volume cannot fit the hardware, this pre/post processing is done on the CPU but the inference sliding window can be done on the GPU. I was wondering how to run the resampling on the GPU as well by leveraging the same kind of mecanism as for the sliding window inference (ie running on patches). Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
First, thanks for the great library!
I had a question regarding inference optimization.
We often have the case where the hardware running the inference has enough GPU for the sliding window but not enough to fit the full volume to GPU. In this case, the preprocessing and post processing on CPU ends up taking more time than the actual sliding window inference.
I was wondering how I should go about to run the preprocessing on the GPU as well.
From my understanding, it should be possible to use something like the GridPatchDataset to iterate over patches, move the patch to GPU device and run the preprocessing on the patches before the actual inference, move back the patch to CPU for stiching afterwards.
The problems with this approach, from what I can see, are :
So my questions are:
Thanks in advance,
Best,
Thibault
Beta Was this translation helpful? Give feedback.
All reactions