[Numpy-discussion] C-coded dot 1000x faster than numpy?

Carl Kleffner cmkleffner at gmail.com
Tue Feb 23 16:03:50 EST 2021


The stackoverflow link above contains a simple testcase:

>>> from scipy.linalg import get_blas_funcs>>> gemm = get_blas_funcs("gemm", [X, Y])>>> np.all(gemm(1, X, Y) == np.dot(X, Y))True

It would be of interest to benchmark gemm against np.dot. Maybe np.dot
doesn't use blas at al for whatever reason?


Am Di., 23. Feb. 2021 um 20:46 Uhr schrieb David Menéndez Hurtado <
davidmenhur at gmail.com>:

> On Tue, 23 Feb 2021, 7:41 pm Roman Yurchak, <rth.yurchak at gmail.com> wrote:
>
>> For the first benchmark apparently A.dot(B) with A real and B complex is
>> a known issue performance wise
>> https://github.com/numpy/numpy/issues/10468
>
>
> I splitted B into a vector of size (N, 2) for the real and imaginary part,
> and that makes the multiplication twice as fast.
>
>
> My configuration (also in Fedora 33) np.show_config()
>
>
>
> blas_mkl_info:
>   NOT AVAILABLE
> blis_info:
>   NOT AVAILABLE
> openblas_info:
>     libraries = ['openblas', 'openblas']
>     library_dirs = ['/usr/local/lib']
>     language = c
>     define_macros = [('HAVE_CBLAS', None)]
> blas_opt_info:
>     libraries = ['openblas', 'openblas']
>     library_dirs = ['/usr/local/lib']
>     language = c
>     define_macros = [('HAVE_CBLAS', None)]
> lapack_mkl_info:
>   NOT AVAILABLE
> openblas_lapack_info:
>     libraries = ['openblas', 'openblas']
>     library_dirs = ['/usr/local/lib']
>     language = c
>     define_macros = [('HAVE_CBLAS', None)]
> lapack_opt_info:
>     libraries = ['openblas', 'openblas']
>     library_dirs = ['/usr/local/lib']
>     language = c
>     define_macros = [('HAVE_CBLAS', None)]
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210223/05fa4d89/attachment.html>


More information about the NumPy-Discussion mailing list