IFFT slow down with using gpuArray
Afficher commentaires plus anciens
Two sets of data A (4096 x 1024) matrix and B (32768 x 1024) matrix have been transferred to the GPU using gpuArray. A is passed into the FFT function and has shown a significant speed increase in comparison to the CPU A data. B is passed into the IFFT function and has shown approximately a 50% decrease in efficiency in comparison to the CPU B data. Is there a reason why the IFFT function does not have the speed increase proportional to the FFT function? I understand the sizes differ but I do no understand why the GPU implemented IFFT is slower then the CPU implemented IFFT. Also, the tic toc function and the run and time function were used to time the results. Thank you for your help.
4 commentaires
Jill Reese
le 3 Mai 2013
What version of MATLAB are you running?
Michael
le 3 Mai 2013
James Lebak
le 3 Mai 2013
Modifié(e) : James Lebak
le 3 Mai 2013
When I time this on MATLAB R2013a, 3.5 GHz Xeon, with a Tesla C2075 GPU, I see 0.36 s for the IFFT of a 32768x1024 matrix on the CPU and 0.051s on the GPU. Here is the code I used:
x=gpuArray.ones(32768,1024);
gd=gpuDevice;
tic;y=ifft(x);wait(gd);toc
xc=gather(x);
tic;y=ifft(xc);toc
And the output:
Elapsed time is 0.050705 seconds.
Elapsed time is 0.364836 seconds.
I would be interested to know what this code shows you, and also whether having the other array that you mentioned in memory changes the performance. I didn't see a change, but I don't have access to this specific card that you have.
Michael
le 3 Mai 2013
Réponse acceptée
Plus de réponses (1)
James Lebak
le 3 Mai 2013
Modifié(e) : James Lebak
le 4 Mai 2013
1 vote
The GeForce GT630M is a mobile graphics card. Frequently, these cards don't perform as well in double-precision as they do in single-precision. If your application can handle single-precision, you can try the IFFT in single and see if that gives you better performance. If you need double precision performance, you might want to try a different card.
This especially applies if the card in question is compute capability 3.0. You can find out the compute capability of the card in MATLAB from the structure returned by 'gpuDevice'.
Edit: removed incorrect identification of the 630M.
5 commentaires
Michael
le 3 Mai 2013
James Lebak
le 3 Mai 2013
You are correct that the card can compute in double-precision, but that doesn't always mean that it can compute faster than your CPU. I apologize for getting the compute capability of your card wrong -- I misread the chart -- but the point is that many Geforce and mobile cards are good at single-precision computation and less good at double-precision.
Michael
le 4 Mai 2013
Michael
le 5 Mai 2013
Catégories
En savoir plus sur GPU Computing in MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!