On Thu, Jul 4, 2019 at 12:37 AM Serge Guelton <serge.guelton@telecom-bretagne.eu> wrote:
On Thu, Jul 04, 2019 at 09:07:22AM +0200, Juan Luis Cano Rodríguez wrote:
> On 7/3/19 10:19 PM, Dieter Werthmüller wrote:
> > I think it was Ralf who said that it would be nice if one could
> > achieve with a simple decorator a speed-up with numba - if it is
> > installed, and otherwise just keep the status quo.

I think there was some pushback on this idea, because it only works for a limited set of functionality. If the speed difference is 100x from some pure-Python for-loop code, the non-numba performance may be unacceptably slow. So it's only helpful for cases like speeding up np.linalg (aside: that particular one we shouldn't use, we have scipy.linalg).

I've talked with multiple people about Numba recently, and I think the broad consensus was that while @jit is nice during development, Numba needs better support for ahead-of-time compilation.

>
> This is what we do in poliastro for example:
>
> https://github.com/poliastro/poliastro/blob/v0.12.0/src/poliastro/core/_jit.py
>
> Also works on PyPy, which in theory should not need numba:
>
> install_requires =
>     ...
>     numba>=0.39 ; implementation_name=='cpython'

(a bit of self-advertisement here)

Thanks Serge. I appreciate your updates on Pythran. My impression is that Pythran is gaining in popularity, and with it being usable within Cython, adopted by Xtensor, and a new project like Transonic (and maybe more?), the maintenance situation and risk of adopting Pythran seems to be going down.


IMHO, this is where Pythran[0] shines: the input code is pure, high-level Python.
And unlike numba, there's no need to explicit loop over arrays,

Numba understands those too I believe. Anyway, many of the more interesting cases for Cython/Numba/Pythran are when pure numpy isn't an option because the algorithm isn't nicely expressable in vectorized form.

Cheers,
Ralf


numpy operations
are supported so the performance loss when falling back to python is acceptable.

Just a maintainer opinion though :-)

++
Serge

[0] https://github.com/serge-sans-paille/pythran
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev@python.org
https://mail.python.org/mailman/listinfo/scipy-dev