[Rcpp-devel] examples of using cula matrix multiplication in Rcpp

Colin Rundel rundel at gmail.com
Sat May 16 21:58:05 CEST 2015


I’ve been playing around with Rcpp and CUDA (CUBLAS and Magma in particular) for quite a while now and definitely find it useful for improving performance. My interest is mostly in spatial models and gaussian processes where the rate limiting step is usually O(n^3) matrix decomposition where n is between 1000 to 5000.

For these types of tasks I routinely see ~2x improvements over RcppArmadillo & OpenBLAS using a $100 consumer grade card, which isn’t huge but makes a big difference when the overall runtime is around 80 hours per model.

If anyone is interested in looking at some code I have the early stages of a package up on github: https://github.com/rundel/RcppGP <https://github.com/rundel/RcppGP>. In particular the gpu_mat class has a reasonably mature interface for moving data between armadillo and cuBLAS.

-Colin

-----

Colin Rundel
Assistant Professor of the Practice
Duke University, Department of Statistical Science
www.stat.duke.edu/~cr173/

> On May 16, 2015, at 12:24 PM, Yue Li <gorillayue at gmail.com> wrote:
> 
> Thanks for the quick insightful replies! I will look into the solutions and keep the list posted on any progress on this end.
> 
> Yue
> 
>> On May 16, 2015, at 12:10 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>> 
>> 
>> On 16 May 2015 at 17:05, Sean O'Riordain wrote:
>> | Some students I have been working with managed to get Rcpp to work with Cuda
>> | for a simple use case - calculating a big log-likelihood for MCMC - and they
>> | got a bit of a speedup compared with Rcpp - but it needs more work.  They
>> | promised they would write up a note for the gallery once their exams are over
>> | in a couple of weeks.
>> 
>> That is splendid news!
>> 
>> I better make sure I can compile with CUDA then or else building the article
>> may be tricky.
>> 
>> Dirk
>> 
>> -- 
>> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> 
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150516/3ae83d1e/attachment.html>


More information about the Rcpp-devel mailing list