From 463421955e4e9eaf27fb5cd98626f52b588f0171 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Mon, 10 Aug 2026 20:52:16 +0200 Subject: [PATCH] GHA: Add NumPy SIMD dispatch diagnostic for flaky Weber_BMC2015 (#3078) Root cause of the AVX-512-correlated flakiness turned out to be NumPy's own runtime SIMD dispatch for transcendental ufuncs (np.power/np.exp), used when unscaling log10/log-scaled PEtab parameters -- not AMICI's own code, SUNDIALS, SuiteSparse, glibc, or OpenBLAS, all of which were directly tested and refuted. See https://github.com/AMICI-dev/AMICI/issues/3078#issuecomment-5244467220 for the full writeup. Add a step that prints NumPy's actual runtime dispatch state (numpy._core._multiarray_umath.__cpu_features__/__cpu_dispatch__) right after NumPy becomes available, so future occurrences show the real variable directly instead of requiring it to be inferred from raw CPU feature flags. Generic hardware diagnostics (dweindl/gha-runner-diagnostics@v1) can't provide this, since they run before Python/NumPy even exist in the job. Co-Authored-By: Claude Sonnet 5 --- .../test_benchmark_collection_models.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/test_benchmark_collection_models.yml b/.github/workflows/test_benchmark_collection_models.yml index 747f0b2b20..2e6e7f9b6e 100644 --- a/.github/workflows/test_benchmark_collection_models.yml +++ b/.github/workflows/test_benchmark_collection_models.yml @@ -63,6 +63,28 @@ jobs: AMICI_PARALLEL_COMPILE="" pip3 install -v --user \ $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis,jax] + # Diagnostic for https://github.com/AMICI-dev/AMICI/issues/3078: root + # cause was NumPy's own runtime SIMD dispatch for transcendental ufuncs + # (np.power/np.exp, used when unscaling log10/log-scaled PEtab + # parameters) picking different, non-bit-identical kernels depending on + # which instruction-set tiers are available on the runner. This can't be + # inferred from generic hardware diagnostics (dweindl/gha-runner-diagnostics@v1, + # which runs before Python/NumPy even exist) -- it has to be queried + # from NumPy directly, after it's installed. + - name: NumPy SIMD dispatch state (#3078) + run: | + python3 -c " + import numpy as np + try: + from numpy._core import _multiarray_umath as mau + except ImportError: + from numpy.core import _multiarray_umath as mau + print('numpy:', np.__version__) + print('baseline:', mau.__cpu_baseline__) + print('dispatch (compiled in):', mau.__cpu_dispatch__) + print('features (active this run):', [k for k, v in mau.__cpu_features__.items() if v]) + " + - name: Install test dependencies run: | python3 -m pip uninstall -y petab && python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@main \