Summary: | dev-python/numpy-1.26.2: Includes faulty float16 implementation on ppc64 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Marcus Comstedt <marcus> |
Component: | Current packages | Assignee: | Gentoo Science Related Packages <sci> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | matoro_gentoo, python |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | PPC64 | ||
OS: | Linux | ||
URL: | https://github.com/numpy/numpy/issues/25178 | ||
See Also: | https://github.com/numpy/numpy/pull/25083 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Marcus Comstedt
2023-11-18 08:22:30 UTC
Does not repro for me on stable clean chroot on BE...must be something flags-related or kernel maybe? Python 3.11.5 (main, Aug 28 2023, 05:57:37) [GCC 12.3.1 20230526] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> np.float16(1.0) 1.0 >>> np.float16(1.0) + 0.0 1.0 >>> np.float16(1.0) + np.float16(0.0) 1.0 >>> import platform ; platform.platform() 'Linux-6.6.1-gentoo-ppc64-ppc64-POWER9_-architected-,_altivec_supported-with-glibc2.37' The full cflags during compilation are: -Inumpy/core/_multiarray_umath.cpython-311-powerpc64-linux-gnu.so.p -Inumpy/core -I../numpy-1.26.2/numpy/core -Inumpy/core/include -I../numpy-1.26.2/numpy/core/include -I../numpy-1.26.2/numpy/core/src/common -I../numpy-1.26.2/numpy/core/src/multiarray -I../numpy-1.26.2/numpy/core/src/npymath -I../numpy-1.26.2/numpy/core/src/umath -I/usr/include/python3.11 -I/tmp/portage/dev-python/numpy-1.26.2/work/numpy-1.26.2-python3_11/meson_cpu -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -std=c99 -O3 -fno-strict-aliasing -mcpu=power9 -DNPY_HAVE_VSX -DNPY_HAVE_VSX_ASM -DNPY_HAVE_VSX2 -DNPY_HAVE_VSX3 -DNPY_HAVE_VSX3_HALF_DOUBLE -O2 -pipe -mcpu=power9 -fno-strict-aliasing -DNDEBUG -fPIC -DHAVE_CBLAS -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 Of this "-O2 -pipe -mcpu=power9" comes from my make.conf, the rest is generated by the make system. I'm wondering if the "-DNPY_HAVE_VSX3_HALF_DOUBLE" is perhaps a bad idea? My P9:s are DD2.2, btw. Python 3.11.5 (main, Oct 21 2023, 17:50:00) [GCC 12.3.1 20230526] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import platform ; platform.platform() 'Linux-5.4.249-ppc64-POWER9,_altivec_supported-with-glibc2.37' >>> Try apply this patch? https://github.com/numpy/numpy/pull/25083 That patch is already included in 1.26.2, AFAICT. I tried removing -DNPY_HAVE_VSX3_HALF_DOUBLE, but the behaviour is the same, so doesn't seem related... OK, I got it. This shows up with -mcpu=power9, and only on BE (does not repro on LE even with -mcpu=power9). You can temporarily work around by removing -mcpu=power9 from CFLAGS. In the meantime I will report upstream. I changed the cflags to say -mcpu=power8 for now, and that got me a working numpy (with VSX2 optimizations). Thanks. The upstreams fix works for me. I just had to change "_core" to "core" in the path name for the patch to apply. |