[R-SIG-Mac] Change to BLAS (from default to Apple vecLib) doesn't report in sessionInfo()

David Novgorodsky d@v|d@novgorod@ky @end|ng |rom gm@||@com
Mon Jan 9 23:24:40 CET 2023


Hi all,

First post, and my apologies if this was addressed already elsewhere, but
did not seem so to me. This post is (I think) purely about the
behavior of sessionInfo()
after I switch the BLAS to Apple's Accelerate vecLib.

I installed R 4.2.2 on macOS Monterey 12.6.2 (with an M1 chip)
successfully. I run sessionInfo() with the following result:

R version 4.2.2 (2022-10-31)

Platform: aarch64-apple-darwin20 (64-bit)

Running under: macOS Monterey 12.6.2



Matrix products: default

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



locale:

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8



attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base



loaded via a namespace (and not attached):

[1] compiler_4.2.2

And then I run a small piece of test code (taken from somewhere, sorry,
can't recall where):

N <- 20000
M <- 2000
X <- matrix(rnorm(N*M),N)
system.time(crossprod(X))

with result

> system.time(crossprod(X))
user  system  elapsed
49.471  0.082  49.553

Then I change my BLAS (using the vecLib supplied as part of the R
installation package), e.g., in the Terminal app:

cd /Library/Frameworks/R.framework/Resources/lib
ln -sf libRblas.vecLib.dylib libRblas.dylib

Afterwards, I restart R. Re-running the small piece of test code above
yields

> system.time(crossprod(X))
user  system  elapsed
0.339  0.015  0.197

which suggests to me that the switch to vecLib did, indeed, succeed.

However, sessionInfo() does something unexpected -- it no longer reports
anything for the BLAS row:

R version 4.2.2 (2022-10-31)

Platform: aarch64-apple-darwin20 (64-bit)

Running under: macOS Monterey 12.6.2



Matrix products: default

LAPACK:
/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib



locale:

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8



attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base



loaded via a namespace (and not attached):

[1] compiler_4.2.2

Anyone have any leads on whether a) this is a problem, and b) how to fix it
(if so)? Seems this has been the case at least for a couple of years, at
least based on an only tangentially related past thread (link here
<https://stat.ethz.ch/pipermail/r-sig-mac/2020-November/013794.html>) where
the responder implicitly shows the same thing -- faster matrix
multiplication, but not reporting of BLAS in sessionInfo().

Thanks,
David

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list