octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave-dev slow down


From: Rik
Subject: Re: octave-dev slow down
Date: Tue, 23 May 2017 08:43:47 -0700

On 05/23/2017 01:37 AM, address@hidden wrote:
Subject:
octave dev slow down
From:
"Dmitri A. Sergatskov" <address@hidden>
Date:
05/22/2017 09:48 PM
To:
octave-maintainers <address@hidden>
List-Post:
<mailto:address@hidden>
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
multipart/alternative; boundary="001a11402b08d27ba4055029b149"
Message:
6

I run some benchmarks with the recent dev vs 4.2.1 and noticed a significant slowdown
for the following test:

a=randn(4000);
tic; a'*a; toc
For both runs I LD_PRELOAD=/usr/lib64/atlas/libtatlas.so
and then repeat with LD_PRELOAD=/usr/lib64/atlas/libsatlas.so
4.2.1:

Elapsed time is 1.61557 seconds. (t)
Elapsed time is 5.02009 seconds. (s)

hg id
ed2239ed5fd3 tip @

Elapsed time is 2.78834 seconds. (t)
Elapsed time is 9.69433 seconds. (s)

Most of other benchmarks (like inv(a)*a, a\b are pretty much the same).

I have discussed this already, but this points out the need to have a set of performance benchmarks that could be run as part of regression testing.  The current BIST tests check that we haven't changed functionality when we add new code, but they don't disclose whether performance has been impaired.  Perhaps Dmitri's tests could begin to form the core of a performance test.

As for the cause of this particular slowdown, I'm guessing that it might be caused by not recognizing that a'*a can be passed directly to BLAS for evaluation.  A long time ago, Octave parsed this _expression_ as (a') * (a).  It evaluated the transpose itself and then passed the temporary transposed matrix and the original matrix to BLAS for the multiplication operation.  However, the BLAS libraries can directly calculate this multiplication product by passing in a transpose flag for the first matrix.  There was a significant speed-up when Octave no longer calculated the transpose itself.

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]