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

 
 

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

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Sat 12 Jul 2014 05:01:59 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Works For Me Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by octavebugs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-07-15 rik5 Open/ClosedOpen Closed
    2014-07-14 rik5 StatusNone Works For Me
    2014-07-12 octavebugs Attached File- Added weird_bug.tar.gz, #31706

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code