[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ATLAS setup and benchmarks
From: |
Paul Kienzle |
Subject: |
Re: ATLAS setup and benchmarks |
Date: |
Tue, 17 Jul 2001 23:10:18 +0100 |
User-agent: |
Mutt/1.2.5i |
Przemek,
For hilb, try:
function retval = hilb (n)
if (nargin != 1)
usage ("hilb (n)");
endif
if (!is_scalar (n) || n != fix (n) || n < 1)
error ("hilb: expecting a positive integer");
endif
retval = [1:n]' * ones (1, n) + ones (n, 1) * [0:n-1];
retval = 1 ./ retval;
endfunction
Also, the mersenne twister random number generator from OctaveSF is
faster than Octave's built-in rand. If you aren't already using it,
then your numbers should improve further.
Octave uses linpack for inverse rather than lapack, so it will not
benefit from atlas. Matlab recently turfed linpack in favour of lapack.
You could try replacing inv.cc with a version which uses the lapack
inverse directly rather than using matrix::inverse() to see if that will
speed things up further.
matrix::prod() is coded directly in C++ using liboctave's matrix
dereferencing function, so there is lots of room for optimization.
Does lapack or blas have a product function? Shouldn't octave be
using it? Since prod is only O(n^2), most computations are going to be
dominated by inv and/or lu, so optimizing it is not a priority.
Are you sure your version of matlab is picking up atlas? How much
does matlab improve with and without atlas?
Does atlas do SMP optimizations?
Paul Kienzle
address@hidden
On Tue, Jul 17, 2001 at 02:37:59PM -0400, Przemek Klosowski wrote:
> Perhaps this would help someone; I describe how we installed
> Atlas-enabled Octave, plus provide some speed benchmarks. My platform:
> Dual PIII 700MHz, 256kB cache, 512MB memory, RedHat 7.1
>
> I downloaded atlas 3.2.1, and unpacked into /opt/ATLAS:
>
> cd /opt/ATLAS
> make config
> ...used defaults (SSE1, threads, default for everything)
> make install arch=Linux_PIIISSE1_2 ... started at 14:40, done around 17:00
>
> To install:
>
> cd /usr/lib
> mv liblapack.a liblapack.a.from.lapack.RPM.provided.by.RH71
> ln -sf /opt/ATLAS/lib/Linux_PIIISSE1_2/lib*a .
>
> The problem is that lapack RPM installs /usr/lib/liblapack.a as well
> as liblapack.so's. I just replaced lapack.a (UGH!)
>
> redoing octave:
>
> cd /opt/octave-2.1.34
> make distclean (to avoid cached configs from other systems, ahem).
> ./configure
> make -j 2
>
> 'make check' takes
> real 1m10.193s
> user 0m40.070s
> sys 0m25.950s
>
> For comparison, octave 2.1.34 with regular BLAS, 'make check' takes
> real 1m37.472s
> user 0m59.510s
> sys 0m31.060s
>
> And other tests:
> ATLAS old BLAS MATLAB 6
> tic;hilb(30)*invhilb(30);toc ans = 2.1666 3.7215 0.1762
> tic;hilb(100)*invhilb(100);toc ans = 78.933 135.08 0.3390
> tic;a=rand(20,20000);b=svd(a);toc ans = 0.89392 1.1263 1.0236
> tic;a=rand(20,200000);b=svd(a);toc ans = 9.3824 11.664 10.4996
> tic;a=rand(2000,2000);b=prod(a);toc ans = 3.8270 3.9275 1.3044
> tic;a=rand(4000,4000);b=prod(a);toc ans = 15.277 15.670 4.6598
> tic;a=rand(500,500);b=inv(a)*a;toc ans = 4.9955 9.8788 2.3128
> tic;a=rand(1000,1000);b=inv(a)*a;toc ans = 40.669 80.180 15.4757
>
> Not too shabby---factor of two improvement, within a factor of 2-3 of
> matlab, except for hilb, which they must have in some optimized form
> (octave scales like n^3 with size, matlab scales like less than n)
>
>
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------