[R-SIG-Mac] Large number calculations causing system crash (Carl Witthoft)

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Thu Feb 10 04:20:43 CET 2022


Joe,

are you sure you are using the native arm64 version of R with the Accelerate bindings (formerly vecLib)? The one really cool thing about M1 is that it is very much faster than any Intel Macs (in some examples more than 10x) so what you report doesn't look right. With your script on a first-generation M1 mac mini (so the slower one) I get:

> source("CuriousResult.R")
matrix multiplication       2.084   0.401   2.488 
tcrossprod                  2.284   0.396    2.68 
transposition and reuse     5.771   0.786   6.557 
elementwise after reshape   4.974   0.586    5.56 
columnwise sapply     5.675   1.451   7.127 
for loop over columns       4.565   1.633   6.199 

so I would suspect that you may be running Intel R emulated and without vecLib?

Cheers,
Simon


> On Feb 10, 2022, at 12:44 PM, Joseph Kunkel <joe using bio.umass.edu> wrote:
> 
> Carl, I would not buy a Mac M1Mag with 64 GB of memory.  I just bought one and it is not as good as my 2013 MacBook Pro with 32 GB and 4 cores.
> 
> With my 2013 MacBook Pro I could configure R to do is matrix multiplication with the fast vecLib library and it would use core doubling so that I was using up to 800% of my resources to do my big math.
> 
> With my 2013 I could run the following benchmark and it would execute in 1/4 the time.
> 
>> source("http://www.bio.umass.edu/biology/kunkel/pub/R/CuriousResult.R")
> 
> matrix multiplication      21.248   1.608   5.891 
> tcrossprod                     20.346   1.454   5.39 
> transposition and reuse    15.881   2.887  18.657 
> elementwise after reshape   9.637   2.144  11.717 
> columnwise sapply          13.447  11.982  25.241 
> for loop over columns      12.435  10.14   22.44 
> 
> Now with R on the MacBook Pro with M1Max it takes longer to do the base multiplication and there is no accelerated option although it does the simpler non sectoral approaches faster …
> 
>> source("http://www.bio.umass.edu/biology/kunkel/pub/R/CuriousResult.R") 
> matrix multiplication      40.476   0.127  40.322 
> tcrossprod                     40.347   0.056  40.282 
> transposition and reuse     6.776   0.005    6.78 
> elementwise after reshape   7.849   0.016   7.868 
> columnwise sapply     4.481   0.114   4.592 
> for loop over columns       4.282   0.271    4.55 
> 
> I am searching for why.
> 
> Joe Kunkel
> -·.  .· ·.  .><((((º>·.  .· ·.  .><((((º>·.  .· ·.  .><((((º> .··.· >=-       =º}}}}}><
> Joseph G. Kunkel, Emeritus Professor
> Biology Department
> UMass Amherst 
> Amherst MA 01003
> joe using bio.umass.edu
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 



More information about the R-SIG-Mac mailing list