build optimizations

30 views
Skip to first unread message

Eric Carlson

unread,
Mar 9, 2011, 12:17:54 PM3/9/11
to pyamg-user
Hello,
I have been using a custom-built sage python installation for my 64-
bit Ubuntu, and just for fun I installed EPD built with MKL. I
installed pyamg-2.0 under this EPD, and tested my simulator under sage
and EPD. The sage version version was 50% faster. In this case, all of
the time difference is in the pyamg solves and grid constructions.On
virtually every other numexpr and numpy/scipy benchmark I've tried,
EPD is always faster.

Under EPD, I have not set any special blas libraries in numpy's
site.cfg. Does PyAMG use atlas/lapack/blas directly? Are there any
other reasons that could explain the performance hit?

Cheers,
Eric

Jacob Schroder

unread,
Mar 10, 2011, 1:34:55 PM3/10/11
to pyamg...@googlegroups.com
Hi Eric,

Thanks for the interesting performance results. PyAMG does not
directly link to BLAS or LAPACK, and only calls BLAS and LAPACK
through NumPy and SciPy. I'm not sure what could be causing a 50%
performance difference. One possibility is that the handful of NumPy
and SciPy functions that PyAMG relies on are faster in sage, for some
reason. In particular, its possible that the sparse mat-mat and
mat-vec routines in scipy.sparse are faster under your sage
installation (perhaps due to a local build of SciPy with optimized
compiler?). Another possibility is that PyAMG relies on some locally
compiled C++ functions in amg_core. Different compiler flags here
could also tilt performance in a direction.

Keep us posted,

Jacob

> --
> You received this message because you are subscribed to the Google Groups "pyamg-user" group.
> To post to this group, send email to pyamg...@googlegroups.com.
> To unsubscribe from this group, send email to pyamg-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyamg-user?hl=en.
>
>

Ondrej Certik

unread,
Mar 10, 2011, 1:49:24 PM3/10/11
to pyamg...@googlegroups.com
On Thu, Mar 10, 2011 at 10:34 AM, Jacob Schroder
<jacob.b....@gmail.com> wrote:
> Hi Eric,
>
> Thanks for the interesting performance results.  PyAMG does not
> directly link to BLAS or LAPACK, and only calls BLAS and LAPACK
> through NumPy and SciPy.  I'm not sure what could be causing a 50%
> performance difference.  One possibility is that the handful of NumPy
> and SciPy functions that PyAMG relies on are faster in sage, for some
> reason.  In particular, its possible that the sparse mat-mat and
> mat-vec routines in scipy.sparse are faster under your sage
> installation (perhaps due to a local build of SciPy with optimized
> compiler?).  Another possibility is that PyAMG relies on some locally
> compiled C++ functions in amg_core.  Different compiler flags here
> could also tilt performance in a direction.

I assume that the blas/lapack in Sage is faster than in EPD for some reason?

Or is there any other explanation?

Ondrej

Beth Carlson

unread,
Mar 10, 2011, 5:45:17 PM3/10/11
to pyamg...@googlegroups.com
As of right now, based on very limited testing, scipy.lib.blas appears to be the culprit. PyAMG solves take about 45% longer under EPD than sage, and scipy.lib.blas.test() takes about 40% longer under EPD. I will bump the discussion to enthought-devel. Either Atlas does a much better job with BLAS than MKL, or scipy.lib.blas does not expose MKL-optimized versions under EPD (MKL license issue?). For non-BLAS stuff integrated in numpy and numexpr, EPD does as good as, or on occasion better than, sage. 

Cheers,
Eric
Reply all
Reply to author
Forward
0 new messages