FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

CI/BUG: add native jobs for s390x, fix bug in `pack_inner` (#30819) by charris · Pull Request #31198 · numpy/numpy · GitHub

/ numpy Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) .py  (1) .template  (1) .yml  (2) All 5 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
46 changes: 33 additions & 13 deletions .github/workflows/linux-ppc64le.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Native ppc64le Linux Test
name: Linux IBM tests

on:
pull_request:
Expand All @@ -19,22 +19,42 @@ concurrency:
cancel-in-progress: true

jobs:
native_ppc64le:
# This job runs only in the main NumPy repository.
# It requires a native ppc64le GHA runner, which is not available on forks.
native_ibm:
# These jobs runs only in the main NumPy repository.
# It requires a native ppc64le and s390x GHA runners, which are not available on forks.
# For more details, see: https://github.com/numpy/numpy/issues/29125
if: github.repository == 'numpy/numpy'
runs-on: ubuntu-24.04-ppc64le-p10
runs-on: ${{ matrix.config.runner }}

strategy:
fail-fast: false
matrix:
config:
- name: "GCC"
- name: "ppc64le/gcc - baseline(default)"
args: "-Dallow-noblas=false"
- name: "clang"
runner: ubuntu-24.04-ppc64le-p10
compiler: "gcc"
- name: "ppc64le/clang - baseline(default)"
args: "-Dallow-noblas=false"

runner: ubuntu-24.04-ppc64le-p10
compiler: "clang"
- name: "s390x/gcc - baseline(default)"
args: "-Dallow-noblas=false"
runner: ubuntu-24.04-s390x
compiler: "gcc"
- name: "s390x/clang - baseline(default)"
args: "-Dallow-noblas=false"
runner: ubuntu-24.04-s390x
compiler: "clang"
- name: "s390x/gcc - baseline(Z15/VXE2)"
args: "-Dallow-noblas=false -Dcpu-baseline=vxe2"
runner: ubuntu-24.04-s390x
compiler: "gcc"
- name: "s390x/clang - baseline(Z15/VXE2)"
args: "-Dallow-noblas=false -Dcpu-baseline=vxe2"
runner: ubuntu-24.04-s390x
compiler: "clang"

name: "${{ matrix.config.name }}"
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
Expand All @@ -52,11 +72,11 @@ jobs:
echo "/home/runner/.local/bin" >> $GITHUB_PATH

- name: Install clang
if: matrix.config.name == 'clang'
if: matrix.config.compiler == 'clang'
run: |
sudo apt install -y clang
export CC=clang
export CXX=clang++
sudo apt install -y clang-20
echo CC=clang-20 >> $GITHUB_ENV
echo CXX=clang++-20 >> $GITHUB_ENV

- name: Meson Build
run: |
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/linux_qemu.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,6 @@ jobs:
fail-fast: false
matrix:
BUILD_PROP:
- [
"ppc64le",
"powerpc64le-linux-gnu",
"ppc64le/ubuntu:22.04",
"-Dallow-noblas=true",
"test_kind or test_multiarray or test_simd or test_umath or test_ufunc",
"ppc64le"
]
- [
"ppc64le - baseline(Power9)",
"powerpc64le-linux-gnu",
"ppc64le/ubuntu:22.04",
"-Dallow-noblas=true -Dcpu-baseline=vsx3",
"test_kind or test_multiarray or test_simd or test_umath or test_ufunc",
"ppc64le"
]
- [
"s390x",
"s390x-linux-gnu",
"s390x/ubuntu:22.04",
"-Dallow-noblas=true",
# Skipping TestRationalFunctions.test_gcd_overflow test
# because of a possible qemu bug that appears to be related to int64 overflow in absolute operation.
# TODO(@seiko2plus): Confirm the bug and provide a minimal reproducer, then report it to upstream.
"(test_kind or test_multiarray or test_simd or test_umath or test_ufunc) and not test_gcd_overflow",
"s390x"
]
- [
"s390x - baseline(Z13)",
"s390x-linux-gnu",
"s390x/ubuntu:22.04",
"-Dallow-noblas=true -Dcpu-baseline=vx",
"(test_kind or test_multiarray or test_simd or test_umath or test_ufunc) and not test_gcd_overflow",
"s390x"
]
- [
"riscv64",
"riscv64-linux-gnu",
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/src/common/simd/vec/arithmetic.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ NPY_FINLINE npyv_u64 npyv_divc_u64(npyv_u64 a, const npyv_u64x3 divisor)
// divide each signed 64-bit element by a precomputed divisor (round towards zero)
NPY_FINLINE npyv_s64 npyv_divc_s64(npyv_s64 a, const npyv_s64x3 divisor)
{
npyv_b64 overflow = npyv_and_b64(vec_cmpeq(a, npyv_setall_s64(-1LL << 63)), (npyv_b64)divisor.val[1]);
npyv_b64 overflow = npyv_and_b64(vec_cmpeq(a, npyv_setall_s64(0x8000000000000000LL)), (npyv_b64)divisor.val[1]);
npyv_s64 d = vec_sel(divisor.val[0], npyv_setall_s64(1), overflow);
return vec_div(a, d);
}
Expand Down
25 changes: 25 additions & 0 deletions numpy/_core/src/multiarray/compiled_base.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,29 @@ pack_inner(const char *inptr,
#else
npy_uint64 arr[4] = {bb[0], bb[1], bb[2], bb[3]};
#endif

#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
#if NPY_SIMD_WIDTH == 16
arr[0] = npy_bswap8(arr[0]);
#elif NPY_SIMD_WIDTH == 32
arr[0] = npy_bswap8(arr[0]);
arr[1] = npy_bswap8(arr[1]);
#else
arr[0] = npy_bswap8(arr[0]);
arr[1] = npy_bswap8(arr[1]);
arr[2] = npy_bswap8(arr[2]);
arr[3] = npy_bswap8(arr[3]);
#endif
#endif
memcpy(outptr, arr, sizeof(arr));
outptr += vstepx4;
} else {
#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
bb[0] = npy_bswap8(bb[0]);
bb[1] = npy_bswap8(bb[1]);
bb[2] = npy_bswap8(bb[2]);
bb[3] = npy_bswap8(bb[3]);
#endif
for(int i = 0; i < 4; i++) {
for (int j = 0; j < vstep; j++) {
memcpy(outptr, (char*)&bb[i] + j, 1);
Expand All @@ -1645,6 +1665,11 @@ pack_inner(const char *inptr,
va = npyv_rev64_u8(va);
}
npy_uint64 bb = npyv_tobits_b8(npyv_cmpneq_u8(va, v_zero));

#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN
bb = npy_bswap8(bb);
#endif

for (int i = 0; i < vstep; ++i) {
memcpy(outptr, (char*)&bb + i, 1);
outptr += out_stride;
Expand Down
2 changes: 1 addition & 1 deletion numpy/_core/tests/test_cpu_features.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class Test_ZARCH_Features(AbstractTest):
features = ["VX", "VXE", "VXE2"]

def load_flags(self):
self.load_flags_auxv()
self.load_flags_cpuinfo("features")


is_arm = re.match(r"^(arm|aarch64)", machine, re.IGNORECASE)
Expand Down
5 changes: 5 additions & 0 deletions numpy/f2py/_backends/meson.build.template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ project('${modulename}',
'buildtype=${buildtype}'
])
fc = meson.get_compiler('fortran')
cc = meson.get_compiler('c')

add_project_arguments(
cc.get_supported_arguments( '-fno-strict-aliasing'), language : 'c'
)

py = import('python').find_installation('''${python}''', pure: false)
py_dep = py.dependency()
Expand Down
Loading

Back | FazBrowse Home | New Git URL