Re: [eigen] GPU with eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi Billy,
> I would like to test using the GPU with Eigen. I was thinking of using
ViennaCL or GPUMatrix. Although GPUMatrix seems a bit new. Has anyone
have experience which can be shared about using Eigen on GPU?
I'm certainly biased, so I'm not giving you a recommendation in favor of
one of the packages.
Nevertheless, I can give you general advice on what to expect and what
not to expect from GPUs. In simple terms, make sure that you have 'large
operations' with sufficient parallelism to be executed on the GPU. As a
rule of thumb, make sure that vectors participating in vector operations
have at least ~10k-50k entries, otherwise the kernel launch overhead (in
the range of 10 us, which is about 20k CPU cycles!) will constitute
significant overhead. Similarly, sparse matrices should have a similar
number of rows/columns to make GPUs efficient. For dense matrices, their
size should be at least 500x500 for the same reason. For more
complicated algorithms such as QR factorizations, this 'minimum useful
size' moves further towards larger sizes because of additional
PCI-Express communications.
Hence, if you mostly operate on small vectors and matrices, for which
Eigen is really great, GPUs may give you a really hard time. In some
cases it's possible to pack data together, but even then manual tweaking
would be required to mitigate the costs of data rearrangements. I tend
not to recommend GPUs at all in such case, unless the operations are
embarrassingly parallel by nature.
Hope that helps :-)
Best regards,
Karli