candle icon indicating copy to clipboard operation
candle copied to clipboard

Extreme slow inference speed on CPU when trying blip example

Open xcmgttacct opened this issue 1 year ago • 4 comments

I have followed the tutorial and set up my first rust example. However, I found that the inference speed is faster compared to torch on GPU (780ms per image vs 800ms on my machine). The example is extremely slow when I change the device to CPU. It takes 57 sec to get the image features and 42 sec to decode the feature. While the torch model only needs 2 sec to finish the inference.

xcmgttacct avatar Feb 19 '24 23:02 xcmgttacct

Did you make sure to do cargo run --release?

soupslurpr avatar Feb 21 '24 09:02 soupslurpr

Thanks, I was running in debug, The release is much faster, takes 4sec to finish the inference. I will try to build with mkl to see if it will be faster.

xcmgttacct avatar Feb 21 '24 15:02 xcmgttacct

Any updates?

soupslurpr avatar Feb 23 '24 05:02 soupslurpr

+1

oatiz avatar Apr 09 '24 08:04 oatiz