Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Hi, On Fri, Feb 11, 2011 at 12:08 AM, Robert Kern wrote: > On Thu, Feb 10, 2011 at 15:32, eat wrote: > > Hi Robert, > > > > On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern > wrote: > >> > >> On Thu, Feb 10, 2011 at 14:29, eat wrote: > >> > Hi Robert, > >> > > >> > On Thu, Feb 10, 2011 at 8:16

Re: [Numpy-discussion] numpy docs dependency problem in Ubuntu

2011-02-10 Thread Robert Kern
On Thu, Feb 10, 2011 at 11:22, Barry Warsaw wrote: > Here's the problem: for Ubuntu, we've had to disable the building of the numpy > documentation package, because its dependencies violate Ubuntu policy.  Numpy > is in our "main" archive but the documentation depends on python-matplotlib, > whic

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Charles R Harris
On Thu, Feb 10, 2011 at 3:08 PM, Robert Kern wrote: > On Thu, Feb 10, 2011 at 15:32, eat wrote: > > Hi Robert, > > > > On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern > wrote: > >> > >> On Thu, Feb 10, 2011 at 14:29, eat wrote: > >> > Hi Robert, > >> > > >> > On Thu, Feb 10, 2011 at 8:16 PM, Rob

Re: [Numpy-discussion] numpy docs dependency problem in Ubuntu

2011-02-10 Thread Pauli Virtanen
to, 2011-02-10 kello 12:22 -0500, Barry Warsaw kirjoitti: [clip: Ubuntu cannot put matplotlib needed by Numpy docs into main] > This lets me get through the build of the docs without the dependency on > matplotlib, and a cursory look at the documentation looks pretty good. > > I'm inclined to prop

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Charles R Harris
On Thu, Feb 10, 2011 at 2:26 PM, Mark Wiebe wrote: > On Thu, Feb 10, 2011 at 10:31 AM, Pauli Virtanen wrote: > >> Thu, 10 Feb 2011 12:16:12 -0600, Robert Kern wrote: >> [clip] >> > One thing that might be worthwhile is to make >> > implementations of sum() and cumsum() that avoid the ufunc machi

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Robert Kern
On Thu, Feb 10, 2011 at 15:32, eat wrote: > Hi Robert, > > On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern wrote: >> >> On Thu, Feb 10, 2011 at 14:29, eat wrote: >> > Hi Robert, >> > >> > On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern >> > wrote: >> >> >> >> On Thu, Feb 10, 2011 at 11:53, eat wrot

[Numpy-discussion] numpy docs dependency problem in Ubuntu

2011-02-10 Thread Barry Warsaw
I hope this message is on-topic for this mailing list! I'm working on the packaging for python-numpy 1.5 in the next version of Ubuntu (11.04 - Natty), and I'm hitting an issue that I'm hoping you can help me with. For reference, the two relevant bugs are: https://bugs.launchpad.net/ubuntu/+sour

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Hi Robert, On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern wrote: > On Thu, Feb 10, 2011 at 14:29, eat wrote: > > Hi Robert, > > > > On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern > wrote: > >> > >> On Thu, Feb 10, 2011 at 11:53, eat wrote: > >> > Thanks Chuck, > >> > > >> > for replying. But don

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Mark Wiebe
On Thu, Feb 10, 2011 at 10:31 AM, Pauli Virtanen wrote: > Thu, 10 Feb 2011 12:16:12 -0600, Robert Kern wrote: > [clip] > > One thing that might be worthwhile is to make > > implementations of sum() and cumsum() that avoid the ufunc machinery and > > do their iterations more quickly, at least for

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Robert Kern
On Thu, Feb 10, 2011 at 14:51, Joshua Holbrook wrote: > Maybe I'm missing something, but why not just implement sum() using > dot() and ones() ? You can't do everything that sum() does with just dot() and ones(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harml

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Robert Kern
On Thu, Feb 10, 2011 at 14:29, eat wrote: > Hi Robert, > > On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern wrote: >> >> On Thu, Feb 10, 2011 at 11:53, eat wrote: >> > Thanks Chuck, >> > >> > for replying. But don't you still feel very odd that dot outperforms sum >> > in >> > your machine? Just to

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Joshua Holbrook
Maybe I'm missing something, but why not just implement sum() using dot() and ones() ? --Josh On Thu, Feb 10, 2011 at 11:49 AM, Pauli Virtanen wrote: > On Thu, 10 Feb 2011 22:38:52 +0200, eat wrote: > [clip] >> I hope so. Please suggest if there's anything that I can do to further >> advance thi

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Pauli Virtanen
On Thu, 10 Feb 2011 22:38:52 +0200, eat wrote: [clip] > I hope so. Please suggest if there's anything that I can do to further > advance this. (My C skills are allready bit rusty, but at any higher > level I'll try my best to contribute). If someone wants to try to improve the situation, here's a

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Hi Pauli, On Thu, Feb 10, 2011 at 8:31 PM, Pauli Virtanen wrote: > Thu, 10 Feb 2011 12:16:12 -0600, Robert Kern wrote: > [clip] > > One thing that might be worthwhile is to make > > implementations of sum() and cumsum() that avoid the ufunc machinery and > > do their iterations more quickly, at

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Hi Robert, On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern wrote: > On Thu, Feb 10, 2011 at 11:53, eat wrote: > > Thanks Chuck, > > > > for replying. But don't you still feel very odd that dot outperforms sum > in > > your machine? Just to get it simply; why sum can't outperform dot? > Whatever >

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Pauli Virtanen
Thu, 10 Feb 2011 12:16:12 -0600, Robert Kern wrote: [clip] > One thing that might be worthwhile is to make > implementations of sum() and cumsum() that avoid the ufunc machinery and > do their iterations more quickly, at least for some common combinations > of dtype and contiguity. I wonder what i

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Robert Kern
On Thu, Feb 10, 2011 at 11:53, eat wrote: > Thanks Chuck, > > for replying. But don't you still feel very odd that dot outperforms sum in > your machine? Just to get it simply; why sum can't outperform dot? Whatever > architecture (computer, cache) you have, it don't make any sense at all that > w

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Thanks Chuck, for replying. But don't you still feel very odd that dot outperforms sum in your machine? Just to get it simply; why sum can't outperform dot? Whatever architecture (computer, cache) you have, it don't make any sense at all that when performing significantly less instructions, you'll

Re: [Numpy-discussion] Rationale for simple_capsule_dtor to be static but non-inline ?

2011-02-10 Thread Charles R Harris
On Thu, Feb 10, 2011 at 4:26 AM, Charles R Harris wrote: > > > On Wed, Feb 9, 2011 at 10:50 PM, David wrote: > >> Hi, >> >> in npy3_compat.h, one function simple_capsule_dtor is defined as static >> but non-inline. AFAIK, there is no reason not to put inline (if >> supported by the compiler of c

Re: [Numpy-discussion] odd performance of sum?

2011-02-10 Thread Charles R Harris
On Thu, Feb 10, 2011 at 8:29 AM, eat wrote: > Hi, > > Observing following performance: > In []: m= 1e5 > In []: n= 1e2 > In []: o= ones(n) > In []: M= randn(m, n) > In []: timeit M.sum(1) > 10 loops, best of 3: 38.3 ms per loop > In []: timeit dot(M, o) > 10 loops, best of 3: 21.1 ms per loop > >

[Numpy-discussion] odd performance of sum?

2011-02-10 Thread eat
Hi, Observing following performance: In []: m= 1e5 In []: n= 1e2 In []: o= ones(n) In []: M= randn(m, n) In []: timeit M.sum(1) 10 loops, best of 3: 38.3 ms per loop In []: timeit dot(M, o) 10 loops, best of 3: 21.1 ms per loop In []: m= 1e2 In []: n= 1e5 In []: o= ones(n) In []: M= randn(m, n) I

Re: [Numpy-discussion] FYI: experimental waf support for numpy

2011-02-10 Thread Pauli Virtanen
Thu, 10 Feb 2011 14:30:37 +0900, David wrote: [clip] > Following recent release of waf 1.6 and its adoption by the samba > project, as well as my own work on integrating waf and bento, I have > spent some time to build numpy with it. Although this is experimental, > it should be possible for people

Re: [Numpy-discussion] Rationale for simple_capsule_dtor to be static but non-inline ?

2011-02-10 Thread Charles R Harris
On Wed, Feb 9, 2011 at 10:50 PM, David wrote: > Hi, > > in npy3_compat.h, one function simple_capsule_dtor is defined as static > but non-inline. AFAIK, there is no reason not to put inline (if > supported by the compiler of course) for a static function defined in a > header. Unless I hear someo

Re: [Numpy-discussion] FYI: experimental waf support for numpy

2011-02-10 Thread David
On 02/10/2011 04:45 PM, Sebastien Binet wrote: > David, > > On Thu, 10 Feb 2011 14:30:37 +0900, David wrote: >> Hi there, >> >> Following recent release of waf 1.6 and its adoption by the samba >> project, as well as my own work on integrating waf and bento, I have >> spent some time to build nump