Announcement

Collapse
No announcement yet.

OpenBLAS 0.3.16 Brings Various CPU Fixes, More Optimizations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CochainComplex
    replied
    Originally posted by tchiwam View Post
    Is ATLAS still a thing ?
    https://numpy.org/devdocs/user/building.html

    Note that both BLAS and CBLAS interfaces are needed for a properly optimized build of NumPy.

    The default order for the libraries are:
    • MKL
    • BLIS
    • OpenBLAS
    • ATLAS
    • BLAS (NetLIB)

    The detection of BLAS libraries may be bypassed by defining the environment variable NPY_BLAS_LIBS , which should contain the exact linker flags you want to use (interface is assumed to be Fortran 77). Also define NPY_CBLAS_LIBS (even empty if CBLAS is contained in your BLAS library) to trigger use of CBLAS and avoid slow fallback code for matrix calculations.
    and can also been used for Octave.

    But if I have found the correct repo on sourceforge development is rather slow compared to e.g. OpenBLAS

    Leave a comment:


  • CochainComplex
    replied
    Originally posted by NobodyXu View Post

    Just in case you don’t know, numpy is writen in C.

    That’s the whole point since python itself is too slow and does not support any real multithreading for computation.

    numpy provides an homogeneous array implementation that is much more space efficient and has faster operations on it compared to the heterogeneous builtin list of python.

    According to my knowledge, all other operations of numpy is built around that.
    This is good input too. Thankyou - I didn't know it (just guessing that some of the functions have to be "hardcoded"). Octave does also have this approach. Some functions are just m-files using builtinfunctions as you would wirte it in octave/matlab native and some are wrapped c(or c++ cant recall it) code.

    Leave a comment:


  • CochainComplex
    replied
    Originally posted by User42 View Post
    Ah I see! I thought you were talking about the Netlib (standard) implementation...

    Numpy has support for anything that implements the BLAS/LAPACK API. It used to be that, by default, it was using Netlib's (correct but slow) implementation.

    Nowadays, it tries to find a better implementation at build time.

    So what you get completely depends on what your distribution chose to do. You can still determine what your version has been linked to.

    Numpy in anaconda comes with MKL by default. If you chose to add the `nomkl` virtual package to prevent conda from using MKL (say if you are on an AMD system or if you figured MKL is not the fastest or is too big or is not compliant enough for another lib, etc.), then OpenBLAS is used and replaces MKL transparently.

    You should be able to use nvidia's cuBLAS as well if you want to. If its ABI is compliant, setting a few environment variables should be enough to swicth. If not, you can try to build numpy yourself. This time, if the API is compliant all should go well.
    Thank you that was the answer I was looking for ...but well my question was asked a bit blurry in the first place.

    Leave a comment:


  • NobodyXu
    replied
    Originally posted by CochainComplex View Post
    ...thx for your post. But i know what openblas, mkl, lapack,blas, nvblas etc are ( I'm a physicist using hpc). My question was what is numpy using as their native blas implemention that's what I have meant by what is its standard lib?
    numpy supposed to be a rather fast pyhton library dispite of its python interpreter language nature. So it has to have some linear algebra acceleration based on a blas library implementation on the backend side.
    Talking about interpreter languages...
    Afaik Matlab e.g. is build against mkl (a reason why some amd user havn't had the full performance of their ryzens at the beginning of zens launch) .
    Octave can be built with a varienty of blas implementations default is openblas. But independently of its build structure you can drop in the nvdia GPU accelerated blas lib with environment variables.

    .
    Just in case you don’t know, numpy is writen in C.

    That’s the whole point since python itself is too slow and does not support any real multithreading for computation.

    numpy provides an homogeneous array implementation that is much more space efficient and has faster operations on it compared to the heterogeneous builtin list of python.

    According to my knowledge, all other operations of numpy is built around that.

    Leave a comment:


  • User42
    replied
    Well it's still better performance than Netlib and though it has not received much love for quite some time, its autotuning ideas are still interesting and would probably do wonders with a microkernel-type approach as used in BLIS.

    Leave a comment:


  • tchiwam
    replied
    Is ATLAS still a thing ?

    Leave a comment:


  • User42
    replied
    Ah I see! I thought you were talking about the Netlib (standard) implementation...

    Numpy has support for anything that implements the BLAS/LAPACK API. It used to be that, by default, it was using Netlib's (correct but slow) implementation.

    Nowadays, it tries to find a better implementation at build time.

    So what you get completely depends on what your distribution chose to do. You can still determine what your version has been linked to.

    Numpy in anaconda comes with MKL by default. If you chose to add the `nomkl` virtual package to prevent conda from using MKL (say if you are on an AMD system or if you figured MKL is not the fastest or is too big or is not compliant enough for another lib, etc.), then OpenBLAS is used and replaces MKL transparently.

    You should be able to use nvidia's cuBLAS as well if you want to. If its ABI is compliant, setting a few environment variables should be enough to swicth. If not, you can try to build numpy yourself. This time, if the API is compliant all should go well.

    Leave a comment:


  • CochainComplex
    replied
    ...thx for your post. But i know what openblas, mkl, lapack,blas, nvblas etc are ( I'm a physicist using hpc). My question was what is numpy using as their native blas implemention that's what I have meant by what is its standard lib?
    numpy supposed to be a rather fast pyhton library dispite of its python interpreter language nature. So it has to have some linear algebra acceleration based on a blas library implementation on the backend side.
    Talking about interpreter languages...
    Afaik Matlab e.g. is build against mkl (a reason why some amd user havn't had the full performance of their ryzens at the beginning of zens launch) .
    Octave can be built with a varienty of blas implementations default is openblas. But independently of its build structure you can drop in the nvdia GPU accelerated blas lib with environment variables.

    .
    Last edited by CochainComplex; 13 July 2021, 07:05 AM.

    Leave a comment:


  • User42
    replied
    OpenBLAS is an optimised BLAS/LAPACK implementation to do linear algebra (e.g. working with matrices and vectors). If you do anything "numpy-like" in your code, there is probably a more efficient way of doing it with this. So it's mainly used in scientific code and, more recently, machine-learning.

    The standard lib is a standard implementation to compare to. It is correct and "naive" in the sense it implements the algorithms strictly as defined (though compilers are allowed to optimise as they see fit). But in spite of that those naive algorithms are slower than the optimised ones (sometimes by orders of magnitude depending on the problem and architecture).

    It does not seem more widely used/known because your everyday programmer is rubbish at maths and does not see mathematical patterns in what they do: they implement things "naively" in a sense...

    OpenBLAS is an open source implementation that is performant, compliant, easy to ship with a program and that does not cripple itself when used on a CPU provided by a competitor.

    Leave a comment:


  • CochainComplex
    replied
    Originally posted by NobodyXu View Post

    It seems that numpy has optional openBLAS support https://stackoverflow.com/questions/...as-integration
    oh you are right. What is the standart lib then?

    Leave a comment:

Working...
X