clEsperanto / pyclesperanto

GPU-accelerated Image Processing library using OpenCL
https://clesperanto.github.io/pyclesperanto
BSD 3-Clause "New" or "Revised" License
31 stars 6 forks source link

add notebook for benchmarking top_hat #201

Closed haesleinhuepf closed 4 months ago

haesleinhuepf commented 5 months ago

In this notebook you can see that top-hat-box in the non-prototype is much faster than in in the protoype. Any ideas why? This could be interesting for the paper, and potentially speed up other operations too.

StRigaud commented 5 months ago

That's .... suspicious (or great, idk).

I run the notebook on my GPU:

I cannot explain the speed gain, but I am happy for it I guess.

Can you make sure all is correct ?

StRigaud commented 5 months ago

@haesleinhuepf, this could be related to a possible acceleration from the separable filters, could be interesting to look at other separable filter to see if we see a similar speed up.

StRigaud commented 5 months ago

@haesleinhuepf this is because of the data type!

If you run the filters on float dtype, prototype and pyclesperanto are approximatively on the same speed. If you run the filters on uint8 dtype, pyclesperanto wins. My guess is that prototype still push/pull all buffer as float in the GPU. So either it is quicker for the GPU to run computation on uint8 than on float, or it is simply the gain in the push/pull operation gain with uint8.

See my updates on the notebook.

PS: also you inversed the disk and square for the skimage footprint. The sphere is REALLY slow for me ....

codecov-commenter commented 5 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.91%. Comparing base (5312515) to head (b0b9478).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #201 +/- ## ======================================= Coverage 84.91% 84.91% ======================================= Files 18 18 Lines 1830 1830 ======================================= Hits 1554 1554 Misses 276 276 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

StRigaud commented 4 months ago

ready to be merge, unless we want to add more