Skip to content

Commit 31aa92d

Browse files
author
peng.li24
committed
ci: pin numpy<2.0; add symbol diagnostics step
numpy 2.x changes symbol visibility — npy_exp, __svml_exp8, cblas_sdot64_ may not be exported as dynamic symbols, causing dlsym fallback to std::exp which differs from numpy 2.x's AVX2 polynomial path (~20% elements 1 ULP off). numpy 1.x (<=1.24.4) exports npy_exp as a dynamic symbol and uses scalar paths that match our npy_exp fallback on non-AVX-512 machines. Add diagnostics step to show numpy version and symbol availability for future debugging.
1 parent fbf3dd7 commit 31aa92d

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
python-version: ${{ matrix.python }}
4242

4343
- name: Install Python dependencies
44-
run: pip install "numpy>=1.23" pybind11 pytest cmake
44+
run: pip install "numpy>=1.23,<2.0" pybind11 pytest cmake
4545

4646
- name: Install system dependencies
4747
run: |
@@ -50,11 +50,27 @@ jobs:
5050
# libgomp1 (OpenMP runtime) and omp.h (OpenMP headers) are bundled
5151
# with GCC on Ubuntu 24.04 — no separate libgomp1-dev package exists
5252
53-
- name: Verify AVX-512 support
53+
- name: Diagnose numpy symbols
5454
run: |
55+
python -c "
56+
import numpy, subprocess, glob, os, ctypes
57+
print('numpy version:', numpy.__version__)
58+
# Find _multiarray_umath.so
59+
so = None
60+
for d in ['core', '_core']:
61+
for f in glob.glob(os.path.join(os.path.dirname(numpy.__file__), d, '_multiarray_umath*.so')):
62+
so = f; break
63+
if so: break
64+
print('numpy so:', so)
65+
if so:
66+
r = subprocess.run(['nm', '-D', so], capture_output=True, text=True)
67+
for sym in ['npy_exp', '__svml_exp8', 'npy_log', 'cblas_sdot64_', 'cblas_sdot']:
68+
found = any(sym in l for l in r.stdout.splitlines())
69+
print(f' {sym}: {\"found\" if found else \"NOT found\"}')
70+
"
5571
grep -q avx512f /proc/cpuinfo \
56-
&& echo "✓ AVX-512 supported — SVML vector path active" \
57-
|| echo "⚠ AVX-512 not detected — SVML bridge falls back to scalar npy_* (still bit-exact)"
72+
&& echo "✓ AVX-512 supported" \
73+
|| echo "⚠ AVX-512 not in cpuinfo"
5874

5975
- name: Configure
6076
run: cmake -S tests -B tests/build -DCMAKE_BUILD_TYPE=Release

0 commit comments

Comments
 (0)