Skip to content

Conversation

sandeepgupta12
Copy link

This PR adds a GitHub Actions workflow to run tests on a native ppc64le (Power) runner.

Runs on PRs to main and maintenance/** branches, and via workflow_dispatch

Builds using spin build --clean -- -Dallow-noblas=true

Installs required build/test dependencies

Runs tests using spin test

Outputs Meson build log if available

This helps ensure compatibility and catch issues specific to the ppc64le architecture.

📌 This is the first step in NumPy Issue #29125 to enable native CI support and future wheel builds for the ppc64le architecture.

cc @rgommers for review

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sandeepgupta12. Here is a first round of review comments.

run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install spin
echo "/home/runner/.local/bin" >> $GITHUB_PATH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used to add ~/.local/bin to the system PATH for subsequent steps in the GitHub Actions workflow, so that installed tools (like spin) can be found and executed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. That should be happening only if pip can't write to its default location and switches to .local. The usual solution to that is to use a virtual environment.

Fine to leave this as is until the self-hosted runner is up, so we have a log to look at for the final tweaks.


- name: Run Tests
run: |
export F90=$(which gfortran)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't doing anything, please remove.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested, thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved this comment, since it wasn't actually addressed.

@charris
Copy link
Member

charris commented Jun 17, 2025

The PyPy failure can be ignored.

@jorenham jorenham changed the title Add native ppc64le CI job using GitHub Actions CI: Add native ppc64le CI job using GitHub Actions Jun 18, 2025
@jorenham jorenham changed the title CI: Add native ppc64le CI job using GitHub Actions CI: Add native ppc64le CI job using GitHub Actions Jun 18, 2025
@sandeepgupta12
Copy link
Author

Hi @rgommers,
Just checking in — do you have any plans or timeline for installing the Power GitHub Actions app on the repository? We're currently blocked on CI enablement for Power (ppc64le) until it's set up.

@rgommers
Copy link
Member

The release secrets have been removed from the repo yesterday (see #29462 (comment)), so that unblocks moving ahead with this PR.

@sandeepgupta12
Copy link
Author

Hi @rgommers ,

Thanks for the update. Great to hear the release secrets issue is resolved. Could you please go ahead with installing the Power GitHub Actions app on the repository? Once that’s in place, we can proceed with enabling CI for Power (ppc64le) without further blockers.

@rgommers
Copy link
Member

@sandeepgupta12 the app is installed now, this job should be able to run once it's approved for use on this repo on your side.

@sandeepgupta12
Copy link
Author

@sandeepgupta12 the app is installed now, this job should be able to run once it's approved for use on this repo on your side.

@rgommers app is approved now. Can you please approve the workflow so that it can run?

@rgommers
Copy link
Member

rgommers commented Sep 3, 2025

It's alive:)

image image

@sandeepgupta12
Copy link
Author

ok. Can you please merge this PR?

@rgommers
Copy link
Member

rgommers commented Sep 3, 2025

First job passed! I'll save some of the build log content for posterity:

Build type: native build
Project name: NumPy
Project version: 2.4.0.dev0+git20250903.69ff429
C compiler for the host machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
C linker for the host machine: cc ld.bfd 2.42
C++ compiler for the host machine: c++ (gcc 13.3.0 "c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0")
C++ linker for the host machine: c++ ld.bfd 2.42
Cython compiler for the host machine: cython (cython 3.1.3)
Host machine cpu family: ppc64
Host machine cpu: ppc64le
Program python3 found: YES (/usr/bin/python3)
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency python found: YES 3.12
Has header "Python.h" with dependency python-3.12: YES 
Compiler for C supports arguments -fno-strict-aliasing: YES 
Message: During parsing cpu-dispatch: The following CPU features were ignored due to platform incompatibility or lack of support:
"XOP FMA4"
Test features "VSX VSX2" : Supported 
Test features "VSX3" : Supported 
Test features "VSX4" : Supported 
Configuring npy_cpu_dispatch_config.h using configuration
Message: 
CPU Optimization Options
  baseline:
    Requested : min
    Enabled   : VSX VSX2
  dispatch:
    Requested : max -xop -fma4
    Enabled   : VSX3 VSX4
More build config output
Library m found: YES
Run-time dependency scipy-openblas found: NO (tried pkgconfig)
Run-time dependency openblas found: YES 0.3.26
Message: BLAS symbol suffix: 
Run-time dependency openblas found: YES 0.3.26
Checking if "Check atomic builtins without -latomic" links: YES 
Program _build_utils/process_src_template.py found: YES (/usr/bin/python3 /tmp/_actions-runner-working-dir/numpy/numpy/numpy/_build_utils/process_src_template.py)
Program _build_utils/tempita.py found: YES (/usr/bin/python3 /tmp/_actions-runner-working-dir/numpy/numpy/numpy/_build_utils/tempita.py)
Configuring __config__.py using configuration
Checking for size of "short" : 2 
Checking for size of "int" : 4 
Checking for size of "long" : 8 
Checking for size of "long long" : 8 
Checking for size of "float" : 4 
Checking for size of "double" : 8 
Checking for size of "long double" : 16 
Checking for size of "size_t" : 8 
Checking for size of "size_t" : 8 (cached)
Checking for size of "wchar_t" : 4 
Checking for size of "off_t" : 8 
Checking for size of "Py_intptr_t" with dependency python-3.12: 8 
Checking for size of "PY_LONG_LONG" with dependency python-3.12: 8 
Has header "complex.h" : YES 
Checking for type "complex float" : YES 
Checking for size of "complex float" : 8 
Checking for type "complex double" : YES 
Checking for size of "complex double" : 16 
Checking for type "complex long double" : YES 
Checking for size of "complex long double" : 32 
...
(all C99 functions present)
...
Checking if "thread_local" compiles: NO 
Checking if "_Thread_local" compiles: YES 
Checking if "__thread" compiles: YES 
Checking if "__declspec(thread)" compiles: NO 
Checking for function "fallocate" : YES 
Header "Python.h" has symbol "HAVE_FTELLO" with dependency python-3.12: YES 
Header "Python.h" has symbol "HAVE_FSEEKO" with dependency python-3.12: YES 
Checking for function "backtrace" : YES 
Checking for function "madvise" : YES 
Has header "features.h" : YES 
Has header "xlocale.h" : NO 
Has header "dlfcn.h" : YES 
Has header "execinfo.h" : YES 
Has header "libunwind.h" : NO 
Has header "sys/mman.h" : YES 
Checking for function "strtold_l" : YES 
Checking if "__attribute__((optimize("unroll-loops")))" compiles: YES 
Checking if "__attribute__((optimize("O3")))" compiles: YES 
Checking if "__attribute__((nonnull(1)))" compiles: YES 
Compiler for C supports arguments -O3: YES 
Message: Long double format: IBM_DOUBLE_DOUBLE_LE
Has header "endian.h" : YES 
Has header "sys/endian.h" : NO 
Compiler for C supports function attribute visibility:hidden: YES 
SIMD config per target
Generating multi-targets for "_umath_tests.dispatch.h" 
  Enabled targets: VSX3, baseline
Generating multi-targets for "argfunc.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "x86_simd_argsort.dispatch.h" 
  Enabled targets: 
Generating multi-targets for "x86_simd_qsort.dispatch.h" 
  Enabled targets: 
Generating multi-targets for "x86_simd_qsort_16bit.dispatch.h" 
  Enabled targets: 
Generating multi-targets for "highway_qsort.dispatch.h" 
  Enabled targets: VSX2
Generating multi-targets for "highway_qsort_16bit.dispatch.h" 
  Enabled targets: VSX2
Generating multi-targets for "loops_arithm_fp.dispatch.h" 
  Enabled targets: VSX3, baseline
Generating multi-targets for "loops_arithmetic.dispatch.h" 
  Enabled targets: VSX4, baseline
Generating multi-targets for "loops_comparison.dispatch.h" 
  Enabled targets: VSX3, baseline
Generating multi-targets for "loops_exponent_log.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_hyperbolic.dispatch.h" 
  Enabled targets: VSX4, baseline
Generating multi-targets for "loops_logical.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_minmax.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_modulo.dispatch.h" 
  Enabled targets: VSX4, baseline
Generating multi-targets for "loops_trigonometric.dispatch.h" 
  Enabled targets: VSX4, VSX3, baseline
Generating multi-targets for "loops_umath_fp.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary_fp.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary_fp_le.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary_complex.dispatch.h" 
  Enabled targets: VSX3, baseline
Generating multi-targets for "loops_autovec.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_half.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "_simd.dispatch.h" 
  Enabled targets: VSX3, VSX4, baseline
Build targets in project: 76

Slowest tests:

 ============================= slowest 10 durations =============================
6.67s setup    build-install/usr/lib/python3/dist-packages/numpy/_core/tests/test_cython.py::test_is_timedelta64_object
5.32s call     build-install/usr/lib/python3/dist-packages/numpy/linalg/tests/test_regression.py::TestRegression::test_openblas_threading
4.24s call     build-install/usr/lib/python3/dist-packages/numpy/f2py/tests/test_f2py2e.py::test_no_py312_distutils_fcompiler
3.95s setup    build-install/usr/lib/python3/dist-packages/numpy/_core/tests/test_limited_api.py::test_limited_api
3.42s call     build-install/usr/lib/python3/dist-packages/numpy/lib/tests/test_nanfunctions.py::TestNanFunctions_Percentile::test_nan_value_with_weight_ndim[2]
3.17s call     build-install/usr/lib/python3/dist-packages/numpy/f2py/tests/test_crackfortran.py::TestNameArgsPatternBacktracking::test_nameargspattern_backtracking[@)@bind                         @(@]
2.75s call     build-install/usr/lib/python3/dist-packages/numpy/_core/tests/test_arrayprint.py::TestArray2String::test_any_text
2.75s call     build-install/usr/lib/python3/dist-packages/numpy/_core/tests/test_arrayprint.py::test_multithreaded_array_printing
2.54s setup    build-install/usr/lib/python3/dist-packages/numpy/f2py/tests/test_crackfortran.py::TestDimSpec::test_inv_array_size[n]
2.44s setup    build-install/usr/lib/python3/dist-packages/numpy/f2py/tests/test_character.py::TestCharacter::test_input[c]

There's a number of these, that looks like an issue in the SIMD testing module:

SKIPPED [210] numpy/_core/tests/test_simd.py: target 'VSX4' isn't supported by current machine
= 45862 passed, 1044 skipped, 2817 deselected, 35 xfailed, 6 xpassed in 307.47s (0:05:07) =

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sandeepgupta12. I reviewed the CI log in detail, it looks pretty good. A few last comments inline.


name: "Native PPC64LE"
steps:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you remove this blank line?


- name: Meson Build
run: |
spin build --clean -- -Dallow-noblas=false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove --clean? It's unnecessary in CI, the build and build-install directories will not exist for a clean checkout.


- name: Run Tests
run: |
export F90=$(which gfortran)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved this comment, since it wasn't actually addressed.

@rgommers
Copy link
Member

rgommers commented Sep 3, 2025

There's a number of these, that looks like an issue in the SIMD testing module:

Note that this isn't a blocker for merging, we can tackle that in a follow-up. It'd be nice if you could check those tests locally if you have a ppc64le machine though, since it's unclear to me why they would be skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Awaiting a code review
Development

Successfully merging this pull request may close these issues.

3 participants