EIG performance

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

EIG performance

Postby melonakos » Thu Jan 13, 2011 2:33 pm

We received the following question from a new Jacket programmer looking to time EIG performance:

One technical issue, though. I'm running the following code:

Code: Select all
profile on
x = 100;
for (i = 0:10000)
     A = rand(x,x);

My results show that for a nVIDIA Quadro FX5800 card, the Jacket calculation is about 5% faster than the MATLAB calculation on a Core i5.
That doesn't make sense for three reasons:
1) As I understand it, an eigenvalue calculation can be run in parallel for a speed boost.
2) The "eig(A)" calculation takes about 98% of the calculation time in this program.
3) A Quadro FX5800 card is extremely powerful, and should be able to drop the eigenvalue calculation time to next-to-nothing.

Of course, it could be that Jacket doesn't/can't accelerate the "eig()" function. Or something else entirely.

Any insights?

Yes, you are right. EIG is a great function to run on the GPU. The benefit you will see from that function will improve as the data sizes increase. There are of course a lot of factors which influence a speedup. My general rule of thumb is that I start hoping to see speedups out of functions for matrix sizes 64x64 and larger. So 100x100 is still pretty close to the parity number that I've seen. You might want to try increasing "x" to understand how performance speedups vary with data size.

My second comment is the code itself. Of course the code you posted doesn't run on the GPU. I'm assuming you have a different version that you are running to do the GPU computation. You'll want to verify that you are using the GEVAL and GSYNC functions properly for timing purposes.

Hope that helps! Feel free to post your code or follow-up comments right here so we can help you further.

John Melonakos (john@arrayfire.com)
User avatar
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am

Return to [archive-commercial] Programming & Development with ArrayFire