Repository navigation
Closed
Labels
57 - Close?Issues which may be closable unless discussion continued
Description
Recently I've upgraded my system to iMac Pro, which has Skylake CPU and one of the test started to fail.
Reproducing code example:
>>> from numpy import array
>>> x = array([1.,2.,3.,4.])
>>> x.dot(x)
Illegal instructionNow, more detailed log:
$ docker run -it --rm alpine:3.9
/ # apk add python3 py3-numpy
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/16) Installing libgcc (8.3.0-r0)
(2/16) Installing libquadmath (8.3.0-r0)
(3/16) Installing libgfortran (8.3.0-r0)
(4/16) Installing openblas (0.3.3-r2)
(5/16) Installing libbz2 (1.0.6-r6)
(6/16) Installing expat (2.2.6-r0)
(7/16) Installing libffi (3.2.1-r6)
(8/16) Installing gdbm (1.13-r1)
(9/16) Installing xz-libs (5.2.4-r0)
(10/16) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(11/16) Installing ncurses-terminfo (6.1_p20190105-r0)
(12/16) Installing ncurses-libs (6.1_p20190105-r0)
(13/16) Installing readline (7.0.003-r1)
(14/16) Installing sqlite-libs (3.26.0-r3)
(15/16) Installing python3 (3.6.8-r2)
(16/16) Installing py3-numpy (1.15.4-r0)
Executing busybox-1.29.3-r10.trigger
OK: 108 MiB in 30 packages
/ # python3
Python 3.6.8 (default, Apr 8 2019, 18:17:52)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import array
>>> x = array([1.,2.,3.,4.])
>>> x.dot(x)
Illegal instructionI've tried to upgrade numpy to the latest version, and still see the problem.
This might be related to the OpenMathLib/OpenBLAS#1947.
Possible workaround, is to set OPENBLAS_CORETYPE environmental variable to haswell prior to starting Python:
/ # export OPENBLAS_CORETYPE=haswell
/ # python3
Python 3.6.8 (default, Apr 8 2019, 18:17:52)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import array
Core: Haswell
>>> x = array([1.,2.,3.,4.])
>>> x.dot(x)
30.0Metadata
Metadata
Assignees
Labels
57 - Close?Issues which may be closable unless discussion continued
Activity
seberg commentedon Apr 29, 2019
@sashkab thanks for reporting, but since it seems to be a known upstream bug, I do not think there is much we can do about it.
However, I am not quite sure which OpenBLAS version the numpy wheels use. @charris do we use 0.3.6 already, or should we make sure to use it for the next wheel release?
charris commentedon Apr 29, 2019
@seberg 1.16 is 3.3+, current master is 3.5, which was the latest not long ago. (checks) Looks like 3.6 was released three hours ago :) @tylerjereddy Want to take a shot at updating the OpenBLAS version?
charris commentedon Apr 29, 2019
Skylake? @matthew-brett Might be related to #13401.
tylerjereddy commentedon Apr 30, 2019
Ok, I'll try to open a PR soon--will have to happen for MacPython ecosystem first, then trickle down to a second PR for NumPy wheels once that is ready / built.
charris commentedon Apr 30, 2019
@tylerjereddy Isn't all that is needed changing
env_vars.shonce the libraries are built? Or is more involved?tylerjereddy commentedon Apr 30, 2019
@charris Yeah it is not bad for numpy-wheels once OpenBLAS binary is built--
.appveyor.ymlneeds two URL changes as well, but should just be 4 character changes overall :)Our dev CI would be similar, except the more "exotic" test platforms that use "manual" builds of OpenBLAS like POWER, but that's hardly critical for now.
mattip commentedon May 30, 2019
Fixed by updating OpenBLAS