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

Dale Smith DSmith at nexidia.com
Mon May 18 15:12:17 CEST 2015


I'm not a big fan of GPU computing for many of the reasons Dirk mentions below and something else I discovered while taking a Coursera class last winter.



CUDA requires significant effort to keep up your skills unless you do it semi-regularly or more often. It's a very hard learning curve. I can't climb that curve at this point in my working life. An occasional user may want to skip CUDA and investigate OpenACC or something related. Do what works best for you. I’ll investigate rCUDA, PyCUDA, OpenACC, etc, and leave the lower-level stuff to others.



I’d like to reiterate that by far the most difficult think about working with GPU technology is efficiently moving data on and off the card. Do you have a rigorously established use case for using GPU technology?



I’m skeptical that tying Rcpp with CUDA is something lots of people should do, but give it a try if you have the expertise and can make the use case. Moving data on and off the card is a third layer between you and the computations…


Dale Smith, Ph.D.
Data Scientist
​
[http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20logo.png]<http://nexidia.com/>

d. 404.495.7220 x 4008   f. 404.795.7221
Nexidia Corporate | 3565 Piedmont Road, Building Two, Suite 400 | Atlanta, GA 30305

[http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20Blog.jpeg]<http://blog.nexidia.com/> [http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20LinkedIn.jpeg] <https://www.linkedin.com/company/nexidia>  [http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20Google.jpeg] <https://plus.google.com/u/0/107921893643164441840/posts>  [http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20twitter.jpeg] <https://twitter.com/Nexidia>  [http://host.msgapp.com/Extranet/96621/Signature%20Images/sig%20Youtube.jpeg] <https://www.youtube.com/user/NexidiaTV>

From: rcpp-devel-bounces at lists.r-forge.r-project.org [mailto:rcpp-devel-bounces at lists.r-forge.r-project.org] On Behalf Of Colin Rundel
Sent: Saturday, May 16, 2015 3:58 PM
To: rcpp-devel at lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] examples of using cula matrix multiplication in Rcpp

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. 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/<http://www.stat.duke.edu/~cr173/>

On May 16, 2015, at 12:24 PM, Yue Li <gorillayue at gmail.com<mailto: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<mailto: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<mailto:edd at debian.org>

_______________________________________________
Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org<mailto: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/20150518/fae74ee6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8361 bytes
Desc: image001.png
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 762 bytes
Desc: image002.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 740 bytes
Desc: image003.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 753 bytes
Desc: image004.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0007.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.jpg
Type: image/jpeg
Size: 749 bytes
Desc: image005.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0008.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 765 bytes
Desc: image006.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150518/fae74ee6/attachment-0009.jpg>


More information about the Rcpp-devel mailing list