-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Power9 instruction gets executed on Power8 #28124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Haven't looked into it closely, thought it was SIMD related first, but not sure now. Unless I am missing build related changes (totally possible), there were no 2.2.1 changes in this code and the code isn't hand-vectorized (very few changes in 2.2.1 and this didn't even change since 2.1 at least). So if you only build with "LLVM daily" when there is a new release of NumPy, then the change here may also be the LLVM daily part? |
@seberg The code with this instruction is in Numpy. Another important thing: numpy on Fedora got updated from version 1.26.4 to version to 2.2.0 around December 12th. Has there been any changes to this code between those versions? @limburgher would you be able to run a numpy scratch build on Fedora with more verbosity so that it prints the entire compiler commands, please? I'd like to see which parameters are being passed to GCC when compiling |
Ah, that is a big step and changes seem very plausible. So SIMD seems not unlikely (i.e. VSX3 is being used now), @seiko2plus would probably know without looking around. If you can easily, it would help to to print:
and you could also try to run with |
@seberg It crashed in both cases:
I wonder if there are Power9 instructions being executed very early. |
@limburgher I learned how to build numpy with higher verbosity. I apologize for the noise. The log is available at https://kojipkgs.fedoraproject.org//work/tasks/1824/127671824/build.log Most, if not all files, are built with |
Nice, I think that narrows it down. It would seem that these tests for CPU capabilities misfire for some reason:
unless this is cross compiling on a power9 machine and the baseline architecture needs to be explicitly set? |
@tuliom no worries. :) |
@limburgher Thanks! I believe I found the issue. That rhel10 code is also being executed on Fedora. I believe we can fix this upstream issue. |
Excellent, thank you! I'll keep and eye on that PR. |
Closing since this came down to a bug in fedora. Please reopen if this is a bug in NumPy and I'm misunderstanding. |
Describe the issue:
From: https://bugzilla.redhat.com/show_bug.cgi?id=2336127
In 2024-12-21, we started to see an MLIR test failure on LLVM daily snapshots running on Rawhide on Power8.
We can only reproduce this issue on Rawhide.
After investigating, I found a numpy function using a Power9/Power ISA 3.0 instruction (mtvsrws):
Disassembly:
(gdb) disas
Dump of assembler code for function HALF_exp2(char**, npy_intp const*, npy_intp const*, void*):
...
0x00007fffe3bad210 <+160>: addis r9,r9,14336
0x00007fffe3bad214 <+164>: add r7,r7,r9
=> 0x00007fffe3bad218 <+168>: mtvsrws vs1,r7
0x00007fffe3bad21c <+172>: xscvspdpn vs1,vs1
0x00007fffe3bad220 <+176>: bl 0x7fffe38b3580 <0000001a.plt_call.exp2f@@GLIBC_2.27>
Backtrace:
(gdb) bt
#0 HALF_exp2 (args=, dimensions=, steps=, __NPY_UNUSED_TAGGEDdata=)
at ../numpy/_core/src/umath/loops_umath_fp.dispatch.c.src:182
#1 0x00007fffe3af615c in generic_wrapped_legacy_loop (__NPY_UNUSED_TAGGEDcontext=, data=, dimensions=,
strides=, auxdata=) at ../numpy/_core/src/umath/legacy_array_method.c:98
#2 0x00007fffe3b0d2f0 in try_trivial_single_output_loop (context=0x7fffffff8410, op=0x7fffffff8b30, order=,
errormask=) at ../numpy/_core/src/umath/ufunc_object.c:969
#3 PyUFunc_GenericFunctionInternal (ufunc=, ufuncimpl=, operation_descrs=0x7fffffff8730, op=0x7fffffff8b30,
casting=NPY_SAME_KIND_CASTING, order=, wheremask=0x0) at ../numpy/_core/src/umath/ufunc_object.c:2237
#4 ufunc_generic_fastcall (ufunc=, args=, len_args=, kwnames=, outer=)
at ../numpy/_core/src/umath/ufunc_object.c:4530
#5 0x00007ffff79e9e30 in PyObject_Vectorcall () from /lib64/libpython3.13.so.1.0
Reproducible: Always
Reproduce the code example:
Error message:
No response
Python and NumPy Versions:
Python 3.13, NumPy 2.2.1
Runtime Environment:
No response
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: