Dear Taras et al.

I just tried the Apple Blas and the old BLAS.  The answers (at least for a 
950x950 correlation matrix ) are identical, the speed difference is trivial.  
My bigCor function does speed up the process compared to base R cor()  by a 
factor of 3-4, and also allows me to handle larger data sets.  The real 
difference in speed was switching from the Intel i9 chip to the Mac M1 Max 
chip.  In comparing older timings, this resulted in a 4x speed up.  

Thanks for the help. 

Bill


> On Feb 22, 2023, at 9:54 AM, William R Revelle <reve...@northwestern.edu> 
> wrote:
> 
> Dear Taras et al.
> 
> I currently use
> 
> BLAS:   
> /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
> LAPACK: 
> /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
> 
> In the help page for R-mac developers it says:
> 
> 
> The BLAS library used by R depends on the way R was compiled (see ‘R 
> Installation and Administration’ manual for details). Current R binaries 
> supplied from CRAN provide both vecLib-based BLAS and reference BLAS shipped 
> with R. vecLib is a part of Apple’s Accelerate framework which provides an 
> optimized BLAS implementation for Mac hardware. Although fast, it is not 
> under our control and may possibly deliver inaccurate results.
> 
> The CRAN binary uses --enable-BLAS-shlib option and two Rblas shared 
> libraries are supplied: libRblas.vecLib.dylib which uses vecLib BLAS and 
> libRblas.0.dylib which uses reference BLAS from R. A symbolic link 
> libRblas.dylib determines which one is used. Currently the default is to use 
> the R BLAS: this is recommended for precision.
> 
> The statement: "Although fast, it is not under our control and may possibly 
> deliver inaccurate results” worries me.  Should it?
> 
> My routines that are most matrix heavy are finding correlations, doing factor 
> analysis using my fa function, and using the CFA function in Lavaan.  
> Accuracy in these results is important,
> 
> But spending several hours finding large correlation matrices has driven me 
> to search for speed.
> 
> 
> Bill
> 
> 
> 
> 
> 
> 
> On Feb 22, 2023, at 12:46 AM, Taras Zakharko <taras.zakha...@uzh.ch> wrote:
> 
> H Bill,
> 
> I am not aware of any packages that do this for you directly. While it is 
> certainly possible to write a Metal shader that will get the job done, it 
> will likely take a substantial amount of non-trivial effort. To further 
> complicate the issue Apple GPUs do not support double-precision computation 
> (used by R).
> 
> Maybe it would be possible for you to accelerate computation used 
> Apple-provided routines from the Acceleration framework (e.g. BLAS and 
> LAPACK)? Many of those routines have access to the hardware matrix 
> accelerators present on Apple hardware and can result in major performance 
> improvements.
> 
> Best,
> 
> Taras
> 
> On 21 Feb 2023, at 18:12, William R Revelle <reve...@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@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> 
> [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

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@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to