[Numpy-discussion] Numpy Benchmarking

David M. Cooke cookedm at physics.mcmaster.ca
Wed Jun 28 13:48:31 CDT 2006


On Wed, 28 Jun 2006 03:22:28 -0500
Robert Kern <robert.kern at gmail.com> wrote:

> joris at ster.kuleuven.ac.be wrote:
> > Hi,
> > 
> >  [TO]: NumPy uses Numeric's old wrapper to lapack algorithms. 
> >  [TO]: 
> >  [TO]: SciPy uses it's own f2py-generated wrapper (it doesn't rely on the
> >  [TO]: NumPy wrapper).
> >  [TO]: 
> >  [TO]: The numpy.dual library exists so you can use the SciPy calls if
> > the [TO]: person has SciPy installed or the NumPy ones otherwise.  It
> > exists [TO]: precisely for the purpose of seamlessly taking advantage of 
> >  [TO]: algorithms/interfaces that exist in NumPy but  are improved in
> > SciPy.
> > 
> > This strikes me as a little bit odd. Why not just provide the
> > best-performing function to both SciPy and NumPy? Would NumPy be more
> > difficult to install if the SciPy algorithm for inv() was incorporated?
> 
> That's certainly the case for the FFT algorithms. Scipy wraps more (and
> more complicated) FFT libraries that are faster than FFTPACK.
> 
> Most of the linalg functionality should probably be wrapping the same
> routines if an optimized LAPACK is available. However, changing the routine
> used in numpy in the absence of an optimized LAPACK would require
> reconstructing the f2c'ed lapack_lite library that we include with the
> numpy source. That hasn't been touched in so long that I would hesitate to
> do so. If you are willing to do the work and the testing to ensure that it
> still works everywhere, we'd probably accept the change.

Annoying to redo (as tracking down *good* LAPACK sources is a chore), but
hardly as bad as it was.

I added the scripts I used to generated lapack_lite.c et al to
numpy/linalg/lapack_lite in svn. These are the same things that were used to
generate those files in recent versions of Numeric (which numpy uses). You
only need to specify the top-level routines; the scripts find the
dependencies.

I'd suggest using the source for LAPACK that Debian uses; the maintainer, Camm
Maguire, has done a bunch of work adding patches to fix routines that have
been floating around. For instance, eigenvalues works better than before (lot
fewer segfaults).

With this, the hard part is writing the wrapper routines. If someone wants to
wrap extra routines, I can do the the lapack_lite generation for them.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Numpy-discussion mailing list