[Numpy-discussion] NumPy nogil API

mark florisson markflorisson88@gmail....
Mon Oct 31 05:48:04 CDT 2011

On 31 October 2011 10:03, Dag Sverre Seljebotn
<d.s.seljebotn@astro.uio.no> wrote:
> Mark: I'm just wondering what you wanted to do with NumPy from Cython -- a
> stopgap solution for SIMD, iterator support, or something else?
> SIMD using NumPy really isn't the best idea long-term because of all the
> temporaries needed in compound expressions, which is really bad on the
> memory bus for anything but tiny arrays. For that I'd rather look at finding
> a nogil core of numexpr or similar.

Yes I'm aware of numexpr and the general problem with array
expressions in NumPy. It's not just about SIMD or iterators, it's as
you say below, there's lots of stuff that wouldn't be available even
if we get SIMD. And if NumPy would get such an API, Cython could
figure out how many (or if) temporaries are actually needed and call
into the NumPy API with inplace operations.

The thing is, how much of NumPy (and numexpr or theano) does Cython
want to reimplement? Will you stop at SIMD with elemental functions?
And will it run on my GPU?

I suppose from a purity perspective I'd just like this functionality
to be available in a library and have my language use the library
efficiently behind my back, instead of implementing everything itself.

> Of course, there is a number of convenient NumPy utility functions which
> would be cool to have in nogil mode... But given that the GIL is a problem
> in so many cases, I wonder how far it is really possible to go even given
> the refactored numpy core.
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
> Pauli Virtanen <pav@iki.fi> wrote:
>> 31.10.2011 09:44, mark florisson kirjoitti: [clip] > Ah, that's too bad.
>> Is it anywhere near ready, or was it abandoned for > ironclad? Could you
>> point me to the code? It's quite ready and working, and as far as I
>> understand, Enthought is shipping it. I haven't used it, though. The code is
>> here: https://github.com/numpy/numpy-refactor Pauli
>> ________________________________
>> NumPy-Discussion mailing list NumPy-Discussion@scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list