omrysendik / DCor

Deep Correlations for Texture Synthesis
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

Synthesis images with GPU use. #4

Open ngonthier opened 5 years ago

ngonthier commented 5 years ago

Hi,

I try to synthesis HD images (1024*1024) with your Deep Corr code but it is really slow. Moreover it seems that my GPU is not really used by MatConvNet during the iterations.

Do you know if I have to add some specific option to use the GPU or how I can speed up the algorithm ?

omrysendik commented 5 years ago

Sure. You should compile MatConvNet Mex files for GPU. But, most of the time is spent on the LBFGSB, which didn't have GPU acceleration when I released my code. There now exists such a package and you can try and replace mine with it.

On Wed, Aug 15, 2018, 13:12 Gonthier Nicolas notifications@github.com wrote:

Hi,

I try to synthesis HD images (1024*1024) with your Deep Corr code but it is really slow. Moreover it seems that my GPU is not really used by MatConvNet during the iterations.

Do you know if I have to add some specific option to use the GPU or how I can speed up the algorithm ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/omrysendik/DCor/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AMyWM55JoItX91GYP_cr08-_ZTtRZqkrks5uQ_QTgaJpZM4V93x_ .

ngonthier commented 5 years ago

Yes, I already have compiled MatConvNet Mex files for GPU before writing the first message. I think you are totally right, most of the time is spent on the LBFGS-B (not on GPU). I didn't know that LBFGSB could be implemented to run faster on GPU. Do you know where I can find such package please ? I didn't find it on Mathworks.com. Thanks.

omrysendik commented 5 years ago

I was looking into this in the past but never completed an integration:

https://github.com/nepluno/lbfgsb-gpu

On Wed, Aug 15, 2018, 17:00 Gonthier Nicolas notifications@github.com wrote:

Yes, I already have compiled MatConvNet Mex files for GPU before writing the first message. I think you are totally right, most of the time is spent on the LBFGS-B (not on GPU). I didn't know that LBFGSB could be implemented to run faster on GPU. Do you know where I can find such package please ? I didn't find it on Mathworks.com. Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/omrysendik/DCor/issues/4#issuecomment-413206421, or mute the thread https://github.com/notifications/unsubscribe-auth/AMyWM6BY5iLA9-cZZwoLgblpsqirXWg5ks5uRCmJgaJpZM4V93x_ .

ngonthier commented 5 years ago

I will see if I can integrate it. Thanks.

ngonthier commented 5 years ago

Hi again,

It seems that the code don't use the GPU just by compiling the Mex files with the GPU option. Moreover when I profile the code, LBFGS is not the bottleneck at all, it seems to be the correlation function.

I try to add some gpuArray in the code and to move the net from the CPU to the GPU but I got a lot of different error most of the time, it seems to be due to the lack of memory on the GPU card.

Do you already have a version of the code using gpuArray ? Do you know how I could speed up the code ?

Best,

omrysendik commented 5 years ago

Adding gpuArray will not help you because the calculation of the correlation doesn't use the MatConvNet GPU backend. I didn't implement such a function because speed wasn't my emphasis.