Abnormally slow GPU sync after running median filter, and running get()
on median filter cupy array result?
#153
Labels
question
Further information is requested
More info on the apparent issue
All the below is with httomolibgpu at commit ce1c15f on
main
.From doing test runs of httomo that make use of padding (from this PR DiamondLightSource/httomo#446), I was running the
median_filter
method and found that when increasing the value for thekernel_size
parameter, the processing of blocks within a section that includedmedia_filter
became quite slow.Initially I thought it was because of the padding feature in httomo, but from some simple profiling of httomo runs using
cProfile
to see where the time was being spent, it looked to be in:get()
method on cupy arrayswhich made me wonder if this slowness could be reproduced outside of httomo.
I believe I have been able to reproduce the slowness outside of httomo via two standalone scripts that depend only on httomolibgpu: one demonstrating the slowness due to GPU synchronisation, and the other demonstrating the slowness due to calling the
.get()
method on a cupy array.I have also seemingly found that this is a peculiarity of
median_filter
but not of other methods. I have randomly chosenpaganin_filter_tomopy
as the method to compare against. Each script allows passing in a single arg,median
orpaganin
, to choose which method to use when doing the check that the script does. The result of running both scripts for bothmedian_filter
andpaganin_filter_tomopy
seem to indicate thatmedian_filter
exhibits the slowness, butpaganin_filter_tomopy
does not.Scripts
GPU synchronisation script
get()
scriptResults
Running the GPU synchronisation script for both methods shows the following:
Running the
get()
script for both methods shows the following:Concluding remarks
I typically develop inside a container so this issue was first found when running inside a container. I have also run the scripts on the host machine outside of a container and can reproduce the slowness of
median_filter
.Perhaps there's something wrong with the random data generated in the scripts? I can also try running on the test data that is in the httomo repo,
tomo_standard.nxs
, and update with results from that experiment.Being reproducible by people other than me would give me more confidence that this is an issue. Until then, I don't think any conclusions should be made yet.
The text was updated successfully, but these errors were encountered: