bugGNU Octave - Bugs: bug #42743, Inconsistent linear algebra...

 
 

bug #42743: Inconsistent linear algebra results - openblas bug?

Submitted by:  Ceral Paquet <octavebugs>
Submitted on:  Sat 12 Jul 2014 05:01:59 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: Works For MeAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 26 Jul 2014 07:08:50 AM UTC, comment #7:

Correction: the mfpmath=sse flag.

Ceral Paquet <octavebugs>
Sat 26 Jul 2014 07:04:47 AM UTC, comment #6:

Final word: recompiling OpenBLAS with the -sse flag (and -O2 or -Os for optimization) fixed the crashes.

Ceral Paquet <octavebugs>
Tue 15 Jul 2014 06:12:02 PM UTC, comment #5:

Ok I spoke too soon - now it's not working.

I trimmed the code down a little and manage to get a panic consistently rather than inconsistent results.

octave:1> weird_bug
ans = done1
ans = done2
ans = 0
ans = 0
ans = 0
octave:2> weird_bug
ans = done1
ans = done2
panic: Segmentation fault -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault

The crash always happens on the 2nd run. The code that causes it is below.

%-------------------------------%
clear

load data

[U S V] = svd(A);
'done1'

[U2 S2 V2] = svd(A);
'done2'

norm(U-U2)
norm(S-S2)
norm(V-V2)
%-------------------------------%

I've found that doing the "small" SVD, i.e. svd(A,0), does not cause a problem only the full version. The crash seems to occur in norm(U-U2,'fro').

Also, this is with OpenBLAS 0.2.9 and OpenBLAS 0.2.10.rc2. It doesn't happen with ATLAS or reference implementations - I am posting a bug report to the OpenBLAS team.

Ceral Paquet <octavebugs>
Tue 15 Jul 2014 05:37:18 PM UTC, comment #4:

The problem went away with OpenBLAS version 0.2.10 so this is no longer an issue.

Ceral Paquet <octavebugs>
Mon 14 Jul 2014 11:59:45 PM UTC, comment #3:

OK good to know - thanks. I emailed the OpenBLAS people and they said wait a few days and try again with the upcoming release (version 0.2.10).

Ceral Paquet <octavebugs>
Mon 14 Jul 2014 01:09:06 AM UTC, comment #2:

This works for me suggesting it is something odd with the OpenBLAS library. I'm running a self-compiled version of 3.8.1 using the default BLAS library from Kubuntu 12.04 (libblas-dev 1.2.20110419-2ubuntu1)

Rik <rik5>
Project Administrator
Sat 12 Jul 2014 05:44:44 PM UTC, comment #1:

Thinking about it, I guess it's mainly weird because the results differ from run to run - albeit only in the 7th or 8th significant figure. Whereas in double precision, the results are identical every run even with 30+ digits displayed.

For quick reference, the Octave file is as follows:

% ----------------------- %
function weird_bug()

load data

X = pinv(A)*B;
num2str(norm(X,'fro'),32)

Ceral Paquet <octavebugs>
Sat 12 Jul 2014 05:01:59 PM UTC, original submission:

I switched to OpenBLAS and started noticing a few inconsistent results in single precision linear algebra calculations. See results below for doing the same calculation using file attached.

I realize this is probably not an Octave issue but I don't know for sure. I wonder if someone more knowledgeable can have a look.

This is with a self-compiled OpenBLAS but the same thing happens with the Debian repo version.

octave:2> weird_bug
ans = 1.64427697658538818359375
octave:3> weird_bug
ans = 1.64427697658538818359375
octave:4> weird_bug
ans = 1.64427721500396728515625
octave:5> weird_bug
ans = 1.64427697658538818359375
octave:6> weird_bug
ans = 1.64427697658538818359375
octave:7> weird_bug
ans = 1.64427697658538818359375
octave:8> weird_bug
ans = 1.64427697658538818359375
octave:9> weird_bug
ans = 1.64427697658538818359375
octave:10> weird_bug
ans = 1.64427697658538818359375
octave:11> weird_bug
ans = 1.64427697658538818359375
octave:12> weird_bug
ans = 1.64427697658538818359375
octave:13> weird_bug
ans = 1.64427697658538818359375
octave:14> weird_bug
ans = 1.64427721500396728515625

Ceral Paquet <octavebugs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31706:  weird_bug.tar.gz added by octavebugs (33KiB - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by octavebugs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Jul 2014 12:19:54 AM UTCrik5Open/ClosedOpen=>Closed
    Mon 14 Jul 2014 01:09:06 AM UTCrik5StatusNone=>Works For Me
    Sat 12 Jul 2014 05:01:59 PM UTCoctavebugsAttached File-=>Added weird_bug.tar.gz, #31706

    Back to the top


    Powered by Savane 3.1-cleanup1