Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878883 - sci-libs/openblas-0.3.20 has a bug that makes dev-python/scipy incorrectly solve an eigenvalue problem
Summary: sci-libs/openblas-0.3.20 has a bug that makes dev-python/scipy incorrectly so...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-31 13:56 UTC by Dima Pasechnik
Modified: 2022-11-12 12:05 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Pasechnik 2022-10-31 13:56:52 UTC
OpenBLAS 0.3.20 has a bug which makes scipy (current in Gentoo version 1.9.3) output an incorrect result for a generalised eigenvalue problem.
Namely, the following is wrong.

$ python3
Python 3.10.7 (main, Oct 10 2022, 13:00:40) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy, numpy
>>> A=numpy.array([[ 1., -2.],[ 3.,  4.]])
>>> B=numpy.array([[ 0.,  7.],[ 2., -3.]])
>>> scipy.linalg.eig(A,B,right=False, left=True, homogeneous_eigvals=False)
(array([-2.10757594+0.j, -0.39228096+0.j]), array([[-0.9905316 , -1.        ],
       [ 0.13728493,  0.26423138]]))


The correct output should be

(array([ 1.82085238+0.j, -0.39228096+0.j]), array([[-0.54007116, -1.        ],
       [-0.84161936,  0.26423138]]))

Found while working on https://trac.sagemath.org/ticket/34658
Comment 1 Michael Orlitzky gentoo-dev 2022-10-31 14:00:31 UTC
Presumably fixed with openblas-0.3.21?
Comment 2 Dima Pasechnik 2022-10-31 14:04:45 UTC
Indeed, apparently, OpenBLAS 0.3.21 fixes the issue (confirmed indirectly, with an out of system tree build).
Comment 3 François Bissey 2022-10-31 19:54:20 UTC
openblas-0.3.20 is currently ~arch in any case so skipping it for 0.3.21 should not cause much trouble. If Dima had stuck to arch he would never have seen the issue :)
Comment 4 Larry the Git Cow gentoo-dev 2022-11-12 12:05:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03f1689aa0d72075183bd999192a363994c41195

commit 03f1689aa0d72075183bd999192a363994c41195
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2022-11-12 11:53:59 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2022-11-12 12:05:19 +0000

    sci-libs/openblas: add 0.3.21
    
    I had to rebase the loongarch patch, and removed an old workaround for
    FFLAGS="-fcheck=bounds" in the test suite, but other than that a
    standard update.
    
    Bug: https://bugs.gentoo.org/726474
    Closes: https://bugs.gentoo.org/878883
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-libs/openblas/Manifest                         |   1 +
 .../openblas/files/openblas-0.3.21-fix-loong.patch | 237 +++++++++++++++++++++
 sci-libs/openblas/openblas-0.3.21.ebuild           | 196 +++++++++++++++++
 3 files changed, 434 insertions(+)