Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 4566  / 2 Years ago, sun, august 28, 2022, 2:16:05

In Ubuntu 20.04, there are many packages for OpenBLAS.


~$ apt search openblas
p libopenblas-base - Optimized BLAS (linear algebra) library (transitional)
p libopenblas-dev - Optimized BLAS (linear algebra) library (dev, meta)
p libopenblas-openmp-dev - Optimized BLAS (linear algebra) library (dev, openmp)
p libopenblas-pthread-dev - Optimized BLAS (linear algebra) library (dev, pthread)
p libopenblas-serial-dev - Optimized BLAS (linear algebra) library (dev, serial)
i A libopenblas0 - Optimized BLAS (linear algebra) library (meta)
p libopenblas0-openmp - Optimized BLAS (linear algebra) library (shared lib, openmp)
i A libopenblas0-pthread - Optimized BLAS (linear algebra) library (shared lib, pthread)
p libopenblas0-serial - Optimized BLAS (linear algebra) library (shared lib, serial)
p libopenblas64-0 - Optimized BLAS (linear algebra) library (shared lib, 64bit, meta)
p libopenblas64-0-openmp - Optimized BLAS (linear algebra) library (shared lib, 64bit, openmp)
p libopenblas64-0-pthread - Optimized BLAS (linear algebra) library (shared lib, 64bit, pthread)
p libopenblas64-0-serial - Optimized BLAS (linear algebra) library (shared lib, 64bit, serial)
p libopenblas64-dev - Optimized BLAS (linear algebra) library (dev, 64bit, meta)
p libopenblas64-openmp-dev - Optimized BLAS (linear algebra) library (dev, 64bit, openmp)
p libopenblas64-pthread-dev - Optimized BLAS (linear algebra) library (dev, 64bit, pthread)
p libopenblas64-serial-dev - Optimized BLAS (linear algebra) library (dev, 64bit, serial)

Which of these packages would yield fastest results?


I intend to do numerical computation (mostly diagonalizing matrices) in GNU Octave. My computer has a Intel Core i3-5005U processor, (in case the optimized package should depend on processor type, please mention which package should be preferred on other types of processors).


I have noticed that there is at least 10x speed improvement when OpenBLAS is used instead of default BLAS.


More From » apt

 Answers
3

The answer to "why?" question may be - to get universal solution for many CPUs and platforms.


Technically all these binary packages came from the same openblas source package.


If we talk about provided library variants for update-alternatives, then after sudo apt-get install "*openblas*" we can count 4 groups with 4 choices:



$ sudo update-alternatives --config libopenblas<Tab>
libopenblas64.so.0-x86_64-linux-gnu libopenblas64.so-x86_64-linux-gnu
libopenblas.so.0-x86_64-linux-gnu libopenblas.so-x86_64-linux-gnu


After installation the pthread is set to default (0 selection) version.


For basic benchmarking we can utilize our old mkl-test.sh script for different alternatives for openblas libraries using update-alternatives.


Below are results for my i7-3537U, for third run (lower is faster, all results are in seconds):
































































Alt library Scilab Julia Python 3 with NumPy R Octave
pthread 0.31 0.76 0.31 0.39 0.31
openmp 0.24 0.75 0.22 0.31 0.22
serial 0.17 0.79 0.17 0.27 0.17
atlas/liblapack 0.31 0.75 0.32 0.52 0.32
lapack/liblapack 0.26 0.76 0.30 0.47 0.28
libmkl_rt (MKL) 0.16 0.76 0.16 0.22 0.16


Better way is to run official benchmarks, but I can't currently understand how to run them.


[#1904] Monday, August 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
riffnkful

Total Points: 390
Total Questions: 123
Total Answers: 110

Location: Puerto Rico
Member since Sat, Mar 13, 2021
3 Years ago
riffnkful questions
Thu, Nov 17, 22, 04:24, 2 Years ago
Mon, Nov 28, 22, 01:40, 2 Years ago
Mon, Jul 11, 22, 13:24, 2 Years ago
Sun, Feb 5, 23, 05:06, 1 Year ago
;