clEsperanto / pyclesperanto_prototype

GPU-accelerated bio-image analysis focusing on 3D+t microscopy image data
http://clesperanto.net
BSD 3-Clause "New" or "Revised" License
207 stars 44 forks source link

Multi-GPU Support #195

Open dkermany opened 2 years ago

dkermany commented 2 years ago

Are there any means of using multiple GPUs to boost available memory, or future plans of enabling support for this? I have access to several GPUs on my machine however I have not been able to find a means of utilizing more than one at a time.

This is for running functions of very large 3D images where tiling produces unwanted results at the borders of the tiles.

haesleinhuepf commented 2 years ago

Hi @dkermany ,

I programmed this attempt towards multi-GPU support long time ago:

It will be a lot of effort to finish this and that's why we're planning this for an upcoming major release (in a year or so).

tiling produces unwanted results at the borders of the tiles.

I presume you are aware you can avoid this by processing image tiles with overlap as shown here: https://haesleinhuepf.github.io/BioImageAnalysisNotebooks/32_tiled_image_processing/tiling_images_with_overlap.html

Last but not least: would it be an option to process parts of your image(s) in separate scripts? E.g. you run one script on GPU1 and another script on GPU2?

dkermany commented 2 years ago

@haesleinhuepf thanks for such a rapid and helpful reply!

It will be a lot of effort to finish this and that's why we're planning this for an upcoming major release (in a year or so).

Thank you for letting me know. This is a great library and I appreciate the effort and will keep an eye out

I presume you are aware you can avoid this by processing image tiles with overlap as shown here:

I was NOT aware of this and how effective overlap can be! Thank you so much for reference!

Last but not least: would it be an option to process parts of your image(s) in separate scripts? E.g. you run one script on GPU1 and another script on GPU2?

Would this not be identical to tiling but faster? Since processing is still done in the context of sub-images that need to be stitched together

haesleinhuepf commented 2 years ago

Would this not be identical to tiling but faster? Since processing is still done in the context of sub-images that need to be stitched together

Yes, I was mostly suggesting this because it is technically feasible, fast (multi-GPU) tiling. 🌞