irreproducable test fails in freshly built octave

Jaroslav Hajek highegg at gmail.com
Sun Dec 7 03:49:12 CST 2008


On Sat, Dec 6, 2008 at 11:29 PM, Thorsten Meyer <thorsten.meyier at gmx.de> wrote:
> Hi,
>
> in octave freshly built from the mercurial sources (on a debian intel machine) I got the following
> test fails:
>  src/DLD-FUNCTIONS/svd.cc ............................... PASS   13/15   FAIL 2
>
> then I tried the tests in an interactive octave session and could not reproduce them.
>
> Then I ran make check again, and this time I got
>  src/DLD-FUNCTIONS/svd.cc ............................... PASS   14/15   FAIL 1
>
>
> with this log entry:
>  ***** test
>  a = single([1, 2, 3; 4, 5, 6]);
>  [u, s, v] = svd (a);
>  assert (u * s * v', a, sqrt (eps('single')));
> !!!!! test failed
> assert (u * s * v',a,sqrt (eps ('single'))) expected
>   1   2   3
>   4   5   6
> but got
>   2.22474  -0.44949   4.22475
>   6.44949   0.10102   8.44949
> maximum absolute error 4.89898 exceeds tolerance 0.000345267>>>>> processing
> /home/thorsten/hg/octave/src/DLD-FUNCTIONS/syl.cc
>
> Then in an octave session I get:
>
> octave:1>  a = single([1, 2, 3; 4, 5, 6]);
> octave:2>  [u, s, v] = svd (a);
> octave:3>  assert (u * s * v', a, sqrt (eps('single')));
> octave:4> u * s * v'
> ans =
>
>   1.0000   2.0000   3.0000
>   4.0000   5.0000   6.0000
>
> octave:5> u * s * v'
> ans =
>
>   1.0000   2.0000   3.0000
>   4.0000   5.0000   6.0000
>
> octave:6> u * s * v'
> ans =
>
>   1.0000   2.0000   3.0000
>   4.0000   5.0000   6.0000
>
>
> And another run of make check:
>  src/DLD-FUNCTIONS/svd.cc ............................... PASS   13/15   FAIL 2
>
>  ***** test
>  a = [1, 2, 3; 4, 5, 6];
>  [u, s, v] = svd (a);
>  assert (u * s * v', a, sqrt (eps));
> !!!!! test failed
> assert (u * s * v',a,sqrt (eps)) expected
>   1   2   3
>   4   5   6
> but got
>   0.71261   2.57477   2.71261
>   3.76273   5.47455   5.76273
> maximum absolute error 0.57477 exceeds tolerance 1.49012e-08  ***** test
>  a = single([1, 2, 3; 4, 5, 6]);
>  [u, s, v] = svd (a);
>  assert (u * s * v', a, sqrt (eps('single')));
> !!!!! test failed
> assert (u * s * v',a,sqrt (eps ('single'))) expected
>   1   2   3
>   4   5   6
> but got
>   2.22474  -0.44949   4.22475
>   6.44949   0.10102   8.44949
> maximum absolute error 4.89898 exceeds tolerance 0.000345267>>>>> processing
> /home/thorsten/hg/octave/src/DLD-FUNCTIONS/syl.cc
>
> What's happening here?
>
> regards
>
> Thorsten
>
>
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave
>

Hi Thorsten,
please try rebuilding with
http://hg.savannah.gnu.org/hgweb/octave/rev/dbe67764e628

although I couldn't reproduce your problem, I discovered and fixed
uninitialized memory problems in diagonal matrix multiplication
routines, and your observations appear exactly like that kind of
problem. As an aside, the dense-diagonal matrix multiplication is now
2.5x faster, i.e. running the benchmark posted earlier:

n = 3000; # set to suitable value
A = rand(n);
D = diag(rand(n,1));
D1 = diag(D);
tic; C1 = dmult (dmult (D1, A), D1); toc
tic; C = D * A * D; toc
norm (C1 - C, 1)

p = randperm (n);
P = eye(n)(p,:);

tic; C1 = A(p,p); toc
tic; C = P * A * P'; toc
norm (C1 - C, 1)

I now get (Core 2 Duo @ 2.8 GHz):

before 8366 (diagonal matrix patches):

Elapsed time is 0.328707 seconds.
Elapsed time is 10.1935 seconds.
ans = 0
Elapsed time is 0.06 seconds.
Elapsed time is 1e+01 seconds.
ans = 0

with 8280 (current tip):
Elapsed time is 0.326571 seconds.
Elapsed time is 0.095397 seconds.
ans = 0
Elapsed time is 0.06 seconds.
Elapsed time is 0.1 seconds.
ans = 0

i.e. the speed-up in full x diagonal matrix multiplication improved
from the former 38x (cf. the earlier post) to about 107x.

regards

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


More information about the Bug-octave mailing list