From f4a3195cc1a8b54deb213fc3056aa4d827a86017 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 10 Oct 2022 06:32:50 -0600 Subject: [PATCH] TST, BLD: Fix failing aarch64 wheel builds. The aarch64 wheel build tests are failing with OOM. The new test for complex128 dot for huge vectors is responsible as the useable memory is incorrectly determined and the check for sufficient memory fails. The fix here is to define the `NPY_AVAILABLE_MEM="4 GB"` environment variable before the test call in `cibw_test_command.sh`. --- numpy/core/tests/test_multiarray.py | 2 +- tools/wheels/cibw_test_command.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 828e7f033096..cacfd5bfc827 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -6693,7 +6693,7 @@ def assert_dot_close(A, X, desired): @pytest.mark.slow @pytest.mark.parametrize("dtype", [np.float64, np.complex128]) - @requires_memory(free_bytes=9*10**9) # complex case needs 8GiB+ + @requires_memory(free_bytes=18e9) # complex case needs 18GiB+ def test_huge_vectordot(self, dtype): # Large vector multiplications are chunked with 32bit BLAS # Test that the chunking does the right thing, see also gh-22262 diff --git a/tools/wheels/cibw_test_command.sh b/tools/wheels/cibw_test_command.sh index b296993fc1d5..cbc735fc07bb 100644 --- a/tools/wheels/cibw_test_command.sh +++ b/tools/wheels/cibw_test_command.sh @@ -11,7 +11,11 @@ if [[ $RUNNER_OS == "Windows" ]]; then PY_DIR=$(python -c "import sys; print(sys.prefix)") mkdir $PY_DIR/libs fi -python -c "import sys; import numpy; sys.exit(not numpy.test('full', extra_argv=['-vvv']))" + +# Set available memory value to avoid OOM problems on aarch64. +# See gh-22418. +export NPY_AVAILABLE_MEM="4 GB" +python -c "import sys; import numpy; sys.exit(not numpy.test('full'))" python $PROJECT_DIR/tools/wheels/check_license.py if [[ $UNAME == "Linux" || $UNAME == "Darwin" ]] ; then