prdm0 / ropenblas

Package to link R language to OpenBLAS library
https://prdm0.github.io/ropenblas/.
GNU General Public License v3.0
50 stars 5 forks source link

How to uninstall ropenblas? #34

Closed kmiddleton closed 2 years ago

kmiddleton commented 2 years ago

After installing, it would be good to have a mechanism to uninstall and return the system to the original BLAS implementation. In my system (Ubuntu 20.04), I am experiencing slower performance using OpenBLAS than the native version. I'm not sure how to revert the changes.

prdm0 commented 2 years ago

Very simple, just install the BLAS library on your system again.

sudo apt-get install libblas-dev liblapack-dev

It's very strange to also have BLAS faster than the OpenBLAS library. I'm really curious to see your code and the brenchmarks you guys made to complete this.

kmiddleton commented 2 years ago

Thanks. I'll run the benchmarks and post back here. I was using ones that I found for comparing various BLAS options on Apple M1.

prdm0 commented 2 years ago

Do not use BLAS, OpenBLAS, MKL, etc on Mac devices. Apple already has consistent implementations of BLAS which is veclib. Libraries like BLAS, OpenBLAS and MKL work best on x86_64 architectures. Especially when it comes to ARM architecture, which in this case is the M1, this being Apple's new bet.

kmiddleton commented 2 years ago

I should have been more specific. I was comparing R's BLAS to Apple's veclib.

prdm0 commented 2 years ago

For example, the ropenblas and rcompiler functions from the ropenblas package could even install the OpenBLAS library on Mac, since you can install it on any Unix. However, they do not install, since the veclib implemented by Apple is more efficient on Apple systems.

Please in your R on your Mac do:

sessionInfo()["BLAS"]

What's the way out?

prdm0 commented 2 years ago

I would like to see the benchmarks and the codes on Ubuntu you got. On an x86_64 architecture, I'm surprised you get better performance using BLAS instead of OpenBLAS.

On Apple systems, it is natural and expected that veclib will perform better than BLAS, OpenBLAS, MKL or any other BLAS implementation version.

kmiddleton commented 2 years ago

Here's the current setting:

> sessionInfo()["BLAS"]
$BLAS
[1] "/opt/OpenBLAS/lib/libopenblas_haswellp-r0.3.20.so"

Trying to revert:

$ sudo apt-get install libblas-dev liblapack-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
libblas-dev is already the newest version (3.9.0-1build1).
liblapack-dev is already the newest version (3.9.0-1build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

It seems like it's not reverting to pre-OpenBLAS.

prdm0 commented 2 years ago

Remove the libblas-dev liblapack-dev libraries and install them again:

apt-get remove libblas-dev liblapack-dev

and

sudo apt-get install libblas-dev liblapack-dev

This will force the hyperlinks to be eliminated and a new clean install to be performed.

kmiddleton commented 2 years ago

I ran

sudo apt-get remove libblas-dev liblapack-dev
sudo apt-get install libblas-dev liblapack-dev

and R still reports:

> sessionInfo()["BLAS"]
$BLAS
[1] "/opt/OpenBLAS/lib/libopenblas_haswellp-r0.3.20.so"

I'm not sure what the next step is. I didn't reboot in between. That's the only thing I can think of.

prdm0 commented 2 years ago

Dear,

remove r-base, libblas-dev and liblapack-dev. Then install R again, with sudo apt-get install r-base. In addition do: sudo rm -R /opt/OpenBLAS

With this it is impossible not to go right, unless you do something wrong.

I closed this topic as it is not a package problem. I feel you have familiarity issues with Linux.