[R-SIG-Mac] Can R on a Mac use the GPU

Adrian Dușa du@@@@dr|@n @end|ng |rom un|buc@ro
Wed Feb 22 07:25:29 CET 2023


This is very interesting, as I intend to buy an ARM Mac just because it has
a lot of GPUs to play with.
Quick question to Simon, who is also developing OpenCL, is there a C level
API to start kernel workers from the C level of my own package?
That would greatly extend the capabilities of my R package C code.

I second Bill's thanks for all your efforts,
Adrian

On Wed, 22 Feb 2023 at 00:31, Simon Urbanek <simon.urbanek using r-project.org>
wrote:

> Bill,
>
> to answer the general part of you question, there are quite a few packages
> that allow you to use your GPU. At the low level you can use OpenCL which
> allows you to write code directly on the GPU and turn it into R functions.
> At a higher level there are frameworks like Torch and Tensorflow that
> support GPUs and there are packages like keras or rTorch that provide
> interfaces to that, e.g. for machine learning models. All those support
> Apple silicon GPUs.
>
> However, you mentioned bigCor which is orthogonal to that. There are
> papers (such as https://doi.org/10.1134/S1995080219050068 ) that describe
> some approaches to using GPUs to compute covariance matrices, but in
> general GPUs don't really give you a large benefit on their own since it is
> a lot more about memory management and using smart algorithms/data
> structures to reduce the necessary computation. You may have more luck
> asking in HPC forums about that since is not really Mac-specifc (and the
> answer may depend on what you are actually trying to do so may need more
> details).
>
> Cheers,
> Simon
>
>
> > On 22/02/2023, at 6:12 AM, William R Revelle <revelle using northwestern.edu>
> wrote:
> >
> > Dear R-Mac users.
> >
> > In trying to speed up a large correlation problem (600K subjects, 6k
> variables,)  which I can do using my bigCor function, I decided it was time
> to learn how to use GPU on my Mac book with its M1 Max gpu.
> >
> > Having spent a day searching the web and trying  various approaches, I
> give up.
> >
> > Are there any packages I can use to do calculations on the GPU part of
> my Mac using R?
> >
> > Thanks.
> >
> > Bill
> >
> > William Revelle                  personality-project.org/revelle.html
> > Professor                               personality-project.org
> > Department of Psychology www.wcas.northwestern.edu/psych/
> > Northwestern University          www.northwestern.edu/
> > Use R for psychology         personality-project.org/r
> > It is 90 seconds to midnight   www.thebulletin.org
> >
> > _______________________________________________
> > R-SIG-Mac mailing list
> > R-SIG-Mac using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> >
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>


-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr. 90-92
050663 Bucharest sector 5
Romania
https://adriandusa.eu

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list