You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling for a target supporting VSX3 optimizations such as -mcpu=power9 on big-endian, numpy.float16 is broken. Targets at VSX2 and below, i.e. -mcpu=power8, are fine.
The problem does not reproduce on little-endian at any optimization level.
This is reflected in the tests, which pass at -mcpu=power8 and have 255 failures at -mcpu=power9. Full test logs: build.log
The snippet below is a minimized reproducer which demonstrates the problem.
Unfortunately impossible to compare against older versions, because this is the first working version using meson which even compiles with -mcpu=power9 due to #24789 .
importnumpyasnpnp.float16(1.0)
np.float16(1.0)+0.0# operand is widened before additionnp.float16(1.0)+np.float16(0.0)
Error message:
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 numpy as np
/usr/lib/python3.11/site-packages/numpy/core/getlimits.py:52: RuntimeWarning: divide by zero encountered in log10
self.precision = int(-log10(self.eps))
>>> np.float16(1.0)
1.0
>>> np.float16(1.0)+0.0 # operand is widened before addition
1.0
>>> np.float16(1.0)+np.float16(0.0)
0.0
Runtime information:
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 sys, numpy; print(numpy.__version__); print(sys.version)
1.26.2
3.11.5 (main, Aug 28 2023, 05:57:37) [GCC 12.3.1 20230526]
>>> print(numpy.show_runtime())
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'numpy_version': '1.26.2',
'python': '3.11.5 (main, Aug 28 2023, 05:57:37) [GCC 12.3.1 20230526]',
'uname': uname_result(system='Linux', node='matoro-ppc64dev', release='6.6.1-gentoo-ppc64', version='#1 SMP Wed Nov 8 14:31:08 EST 2023', machine='ppc64')},
{'simd_extensions': {'baseline': ['VSX', 'VSX2'],
'found': ['VSX3'],
'not_found': ['VSX4']}}]
None
Context for the issue:
No response
The text was updated successfully, but these errors were encountered:
Describe the issue:
Downstream bug: https://bugs.gentoo.org/917544
When compiling for a target supporting VSX3 optimizations such as
-mcpu=power9
on big-endian,numpy.float16
is broken. Targets at VSX2 and below, i.e.-mcpu=power8
, are fine.The problem does not reproduce on little-endian at any optimization level.
This is reflected in the tests, which pass at
-mcpu=power8
and have 255 failures at-mcpu=power9
. Full test logs: build.logThe snippet below is a minimized reproducer which demonstrates the problem.
Unfortunately impossible to compare against older versions, because this is the first working version using meson which even compiles with
-mcpu=power9
due to #24789 .If you don't have it available, I offer free shell access to the machines I used to reproduce this here.
CC @seiko2plus @zeldin
Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: