RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1179055 - ATLAS xerbla can't be overidden.
Summary: ATLAS xerbla can't be overidden.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: numpy
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Nikola Forró
QA Contact: Mirek Długosz
URL: https://github.com/numpy/numpy/issues...
Whiteboard:
Depends On: 1172834
Blocks: 1465906
TreeView+ depends on / blocked
 
Reported: 2015-01-06 03:27 UTC by Orion Poplawski
Modified: 2018-04-10 08:35 UTC (History)
18 users (show)

Fixed In Version: numpy-1.7.1-13.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of: 1172834
Environment:
Last Closed: 2018-04-10 08:34:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Override LAPACK XERBLA (11.02 KB, patch)
2017-01-04 16:31 UTC, Nikola Forró
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0659 0 None None None 2018-04-10 08:35:18 UTC

Description Orion Poplawski 2015-01-06 03:27:15 UTC
+++ This bug was initially created as a clone of Bug #1172834 +++

Description of problem:
ATLAS xerbla exits on error. Numpy normally overrides that function, but that seems to no longer work in fedora 21.

How reproducible: Always


Steps to Reproduce:

charris@localhost [~]$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18) 
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
 ** On entry to DLASCL parameter number  4 had an illegal value
charris@localhost [~]$ 

Expected results:
Raises an error and Python continues.


Additional info:
You might be building ATLAS with -Wl,-Bsymbolic-functions, which will cause the problem.

--- Additional comment from charles harris on 2014-12-10 16:15:15 EST ---

The numpy is locally built and linked to libtatlas. I note that Fedora numpy is linked to libsatlas, not sure why.

--- Additional comment from Frantisek Kluknavsky on 2014-12-12 08:31:08 EST ---

I can confirm the different behavior of numpy between f20 and f21. Problem does not seem to be in atlas, my mini-example with custom xerbla works fine, with both satlas and tatlas. Compiled with Makefile:
CC=gcc
F90=gfortran
test: main.o routines.o Makefile
        $(CC) -o test main.o routines.o -lm -lgfortran -L/usr/lib64/atlas -ltatlas
%.o: %.c
        $(CC) -Wall -O2 -g -c $< -o $@
%.o: %.f90
        $(F90) -Wall -O2 -g -c $< -o $@

Call dgemm('','n',m,n,k,1.0,a,m,b,k,0.0,c,m) with wrong first parameter kills the process - default xerbla. With
 subroutine xerbla(SRNAME, INFO)
  CHARACTER*(*)      SRNAME
  INTEGER            INFO
  PRINT *, "Hello World!"
 end subroutine xerbla
in routines.f90 it prints the hello message and process continues - successful override.

Maybe something changed in numpy?

I do not know why numpy is linked to serial and not threaded atlas in Fedora. One probable answer might be that threaded atlas is currently broken on architectures with weak cache coherency, or maybe because it can not detect the number of cores at runtime and to get real benefits you need to recompile atlas yourself, or maybe because someone wants to use numpy as a generic library and do his own parallelization. Many problems with threaded atlas for little benefit.

--- Additional comment from Orion Poplawski on 2014-12-12 22:36:07 EST ---

This because multiple numpy shared libraries are linked against atlas:

rpm -ql numpy | grep -F .so | while read so; do ldd $so | grep atlas && echo $so; done
        libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007fd169763000)
/usr/lib64/python2.7/site-packages/numpy/core/_dotblas.so
        libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f7135291000)
/usr/lib64/python2.7/site-packages/numpy/linalg/_umath_linalg.so
        libsatlas.so.3 => /usr/lib64/atlas/libsatlas.so.3 (0x00007f67f2df9000)
/usr/lib64/python2.7/site-packages/numpy/linalg/lapack_lite.so

But the xerbla_ override is not in _dotblas.so and that is getting loading first.

--- Additional comment from Orion Poplawski on 2014-12-12 22:48:27 EST ---

I've updated the upstream issue tracker:
https://github.com/numpy/numpy/issues/5362

Would have been nice to have mentioned that link in the original report.

--- Additional comment from charles harris on 2014-12-19 20:13:23 EST ---

PR https://github.com/numpy/numpy/pull/5382 for numpy fixes this, but you will probably need to fix the fedora version of numpy yourself. All that seems to be needed is to move the linalg import in numpy/__init__.py before the import of core. The fix *does not work* if site.cfg is used for the setup instead of being automatically detected as by PR https://github.com/numpy/numpy/pull/5364.

--- Additional comment from charles harris on 2014-12-19 20:22:52 EST ---

NVM, still broken, needs work.

--- Additional comment from charles harris on 2014-12-24 14:01:40 EST ---

See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but the same fix is needed for the 1.8.2 that is in Fedora.

--- Additional comment from marcindulak on 2015-01-02 09:23:06 EST ---

(In reply to charles harris from comment #7)
> See https://github.com/numpy/numpy/pull/5392. That patch is for 1.9.x, but
> the same fix is needed for the 1.8.2 that is in Fedora.

the problem is present also on RHEL7: numpy-1.7.1-10.el7.x86_64

Comment 2 Jan Chaloupka 2015-01-07 13:37:37 UTC
Hi Orion,

using commit [1] for the  numpy/core/blasdot/python_xerbla.c and numpy/core/setup.py, I get the following:

python
Python 2.7.5 (default, Feb 11 2014, 07:46:25) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
(array([ nan]), array([ nan]), 1, array([ nan]))
>>>

Is this expected behaviour? Your expected behaviour is to raise an error, in this case the result is "(array([ nan]), array([ nan]), 1, array([ nan]))" containing nan. Is this still OK?

[1] https://github.com/numpy/numpy/commit/f0b2dd7d5151878f2b4b3ea20ff551b27243f27d

Comment 3 Jan Chaloupka 2015-01-09 09:51:23 UTC
Anyway, as this component is not on ACL, rhel-7.1 is in its final phase before GA and this issue is not urgent, moving this to rhel-7.2.

Comment 4 charles harris 2015-01-09 19:29:04 UTC
Hi Jan,

That looks like you aren't linked with ATLAS, but using the numpy fallback. Earlier versions of Numpy will not automatically find ATLAS 3.10.

Comment 5 Orion Poplawski 2015-01-12 18:08:27 UTC
I would have expected:

>>> np.linalg.lstsq([[np.nan]]*2, [1]*2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/numpy/linalg/linalg.py", line 1867, in lstsq
    0, work, lwork, iwork, 0)
ValueError: On entry to DLASCL parameter number 4 had an illegal value
>>>

Comment 6 Jan Chaloupka 2015-01-18 21:10:41 UTC
Thanks Charles,

how can I set numpy to find ATLAS 3.10?

Orion,

right, exception should be raised.

Comment 7 charles harris 2015-01-24 15:16:09 UTC
@Jan Chaloupka

Use site.cfg with

[DEFAULT]
library_dirs = /usr/lib64
include_dirs = /usr/include

# Atlas
# -----
# Atlas is an open source optimized implementation of the BLAS and Lapack
# routines. Numpy will try to build against Atlas by default when available in
# the system library dirs. To build numpy against a custom installation of
# Atlas you can add an explicit section such as the following. Here we assume
# that Atlas was configured with ``prefix=/opt/atlas``.
#
[atlas]
library_dirs = /usr/lib64/atlas
include_dirs = /usr/include
atlas_libs = tatlas
lapack_libs = tatlas

Comment 10 Nikola Forró 2017-01-04 16:31:31 UTC
Created attachment 1237233 [details]
Override LAPACK XERBLA

Comment 11 Nikola Forró 2017-01-04 16:35:52 UTC
Marcin, what info do you need?

Comment 12 marcindulak 2017-01-04 22:16:36 UTC
Whether there is any progress here

Comment 13 Nikola Forró 2017-01-05 10:59:08 UTC
The problem is not in numpy not being linked with ATLAS, but there is another upstream commit [1] that needs to be backported for the fix to work.

The issue is resolved with the attached patch.

[1] https://github.com/numpy/numpy/commit/374e0b4d2c6f44fdccccfefe0546b607e5291e64

Comment 19 errata-xmlrpc 2018-04-10 08:34:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0659


Note You need to log in before you can comment on or make changes to this bug.