Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2014-01-08 Thread Julian Taylor
On 18.07.2013 15:36, Nathaniel Smith wrote: On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien no...@nouiz.org wrote: On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith n...@pobox.com wrote: It's entirely possible I

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2014-01-08 Thread Frédéric Bastien
Hi, As told, I don't think Theano swap the stride buffer. Most of the time, we allocated with PyArray_empty or zeros. (not sure of the capitals). The only exception I remember have been changed in the last release to use PyArray_NewFromDescr(). Before that, we where allocating the PyArray with

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2014-01-08 Thread Nathaniel Smith
On Wed, Jan 8, 2014 at 12:13 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 18.07.2013 15:36, Nathaniel Smith wrote: On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien no...@nouiz.org wrote: On the usefulness of doing only 1 memory allocation, on our old gpu ndarray, we where doing 2

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2014-01-08 Thread Frédéric Bastien
On Wed, Jan 8, 2014 at 3:40 PM, Nathaniel Smith n...@pobox.com wrote: On Wed, Jan 8, 2014 at 12:13 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 18.07.2013 15:36, Nathaniel Smith wrote: On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien no...@nouiz.org wrote: On the usefulness of

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-18 Thread Nathaniel Smith
On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien no...@nouiz.org wrote: On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith n...@pobox.com wrote: It's entirely possible I misunderstood, so let's see if we can work it

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-17 Thread Nathaniel Smith
On Tue, Jul 16, 2013 at 7:53 PM, Frédéric Bastien no...@nouiz.org wrote: Hi, On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma arinkve...@gmail.com wrote: Each ndarray does two mallocs, for the obj and buffer. These could

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-17 Thread Frédéric Bastien
On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 7:53 PM, Frédéric Bastien no...@nouiz.org wrote: Hi, On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-17 Thread Charles R Harris
On Wed, Jul 17, 2013 at 10:57 AM, Frédéric Bastien no...@nouiz.org wrote: On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 7:53 PM, Frédéric Bastien no...@nouiz.org wrote: Hi, On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith

[Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Arink Verma
Hi, I am working on performance parity between numpy scalar/small array and python array as GSOC mentored By Charles. Currently I am looking at PyArray_Return, which allocate separate memory just for scalar return. Unlike python which allocate memory once for returning result of scalar

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Nathaniel Smith
On 16 Jul 2013 11:35, Arink Verma arinkve...@gmail.com wrote: Hi, I am working on performance parity between numpy scalar/small array and python array as GSOC mentored By Charles. Currently I am looking at PyArray_Return, which allocate separate memory just for scalar return. Unlike python

Re: [Numpy-discussion] Speedup by avoiding memory alloc twice in scalar array

2013-07-16 Thread Frédéric Bastien
Hi, On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma arinkve...@gmail.com wrote: Each ndarray does two mallocs, for the obj and buffer. These could be combined into 1 - just allocate the total size and do some pointer