3 ms·
I am curious. Usually in numpy basic linear algebra are delegated to BLAS and potentially really fast if configured to use a fast BLAS implementation (OpenBLAS,
by timeu 11y ago
I am curious. Usually in numpy basic linear algebra are delegated to BLAS and potentially really fast if configured to use a fast BLAS implementation (OpenBLAS, MKL, etc).
Does the numpy fork of PyPy use the same approach ?
- fijal 11y agoyes, but BLAS only helps you with some operations and not others. In fact most of "basic" operations are still done "by hand" in some templated C in numpy. Additionally, doing vectorized operations lazily (which is not present right now in pypy but was at least considered in the past) yields great improvements.
- timeu 11y agosounds great. I have a scientfic library that relies on a mix of loops and matrix multiplication. I need to find some time to test it with PyPy
- pwang 11y agoHave you also checked out Numba? JIT and type inference, but native to CPython and designed for numerics: http://numba.pydata.org http://numba.pydata.org
- mattip 11y agoyes. However the delegation only happens if you use the numpy.linalg module, or if numpy has chosen internally to call the numpy.linalg module (i.e. logic in numpy.dot will call out for large ndarrays) Our vectorizing JIT can use SIMD semantics on all numpy looping calls. For instance, non-matrix multiply A*B or for ndarray + scalar calls While many numpy users are in the habit of manipulating large square matrices, there is a significant number of users who use small arrays, or process RGB pixels