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 wrote: > On Wed, Jan 8, 2014 at 12:13 PM, Julian Taylor > wrote: >> On 18.07.2013 15:36, Nathaniel Smith wrote: >>> On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien wrote: On the usefulness of doing only 1 memory allocation, on our old gpu >

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 wrote: > On 18.07.2013 15:36, Nathaniel Smith wrote: >> On Wed, Jul 17, 2013 at 5:57 PM, Frédéric Bastien wrote: >>> On the usefulness of doing only 1 memory allocation, on our old gpu ndarray, >>> we where doing 2 alloc on the GPU, one for metadata

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 the

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 wrote: >> On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith wrote: On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith wrote: >>> It's entirely possible I misunderstood, so let's see if we can

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 wrote: > On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith wrote: >> > >> > On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith wrote: >> It's entirely possible I misunderstood, so let's see if we can work it >> out. I know that you want to assign

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 wrote: > > > > On Wed, Jul 17, 2013 at 10:39 AM, Nathaniel Smith wrote: > >> On Tue, Jul 16, 2013 at 7:53 PM, Frédéric Bastien >> wrote: >> > Hi, >> > >> > >> > On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith >> wrote: >> >> >> >> On Tue, Ju

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 wrote: > On Tue, Jul 16, 2013 at 7:53 PM, Frédéric Bastien wrote: > > Hi, > > > > > > On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith wrote: > >> > >> On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma > wrote: > >>> > >>> >Each ndarray does two ma

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 wrote: > Hi, > > > On Tue, Jul 16, 2013 at 11:55 AM, Nathaniel Smith wrote: >> >> On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma wrote: >>> >>> >Each ndarray does two mallocs, for the obj and buffer. These could be >>> > combined into 1 - just allo

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 wrote: > On Tue, Jul 16, 2013 at 2:34 PM, Arink Verma 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 >> >arithmetic, then set OWNDATA

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" 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 which allocate

[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 operatio