1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
#!/bin/bash
source activate $CONDA_ENV
# Make sure any error below is reported as such
set -v -e
# If the build is a "Vanilla" variant, then remove the setuptools package. It
# was installed at build time for setup.py to use, but is an _optional_ runtime
# dependency of Numba and therefore shouldn't be present in "Vanilla" testing.
# This package is "force" removed so that its removal doesn't uninstall
# things that might depend on it (the dependencies are present but are not of
# interest to Numba as those code paths are not used by Numba).
if [ "${VANILLA_INSTALL}" == "yes" ]; then
conda remove --force -y setuptools
fi
# Ensure the README is correctly formatted
if [ "$BUILD_DOC" == "yes" ]; then rstcheck README.rst; fi
# Ensure that the documentation builds without warnings
pushd docs
if [ "$BUILD_DOC" == "yes" ]; then make SPHINXOPTS=-W clean html; fi
popd
# Run system and gdb info tools
if [ "${VANILLA_INSTALL}" == "yes" ]; then
# Vanilla install has no access to pkg_resources as setuptools is removed,
# so run these via their modules.
python -m numba -s
python -m numba -g
else
pushd bin
numba -s
numba -g
popd
fi
# switch off color messages
export NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
# switch on developer mode
export NUMBA_DEVELOPER_MODE=1
# enable the fault handler
export PYTHONFAULTHANDLER=1
# Disable NumPy dispatching to AVX512_SKX feature extensions if the chip is
# reported to support the feature and NumPy >= 1.22 as this results in the use
# of low accuracy SVML libm replacements in ufunc loops.
_NPY_CMD='from numba.misc import numba_sysinfo;\
sysinfo=numba_sysinfo.get_sysinfo();\
print(sysinfo["NumPy AVX512_SKX detected"] and
sysinfo["NumPy Version"]>="1.22")'
NUMPY_DETECTS_AVX512_SKX_NP_GT_122=$(python -c "$_NPY_CMD")
echo "NumPy >= 1.22 with AVX512_SKX detected: $NUMPY_DETECTS_AVX512_SKX_NP_GT_122"
if [[ "$NUMPY_DETECTS_AVX512_SKX_NP_GT_122" == "True" ]]; then
export NPY_DISABLE_CPU_FEATURES="AVX512_SKX"
fi
# deal with threading layers
if [ -z ${TEST_THREADING+x} ]; then
echo "INFO: Threading layer not explicitly set."
else
case "${TEST_THREADING}" in "workqueue"|"omp"|"tbb")
export NUMBA_THREADING_LAYER="$TEST_THREADING"
echo "INFO: Threading layer set as: $TEST_THREADING"
;;
*)
echo "INFO: Threading layer explicitly set to bad value: $TEST_THREADING."
exit 1
;;
esac
fi
# If TEST_THREADING is set in the env, then check that Numba agrees that the
# environment can support the requested threading.
function check_sysinfo() {
cmd="import os;\
from numba.misc.numba_sysinfo import get_sysinfo;\
assert get_sysinfo()['$1 Threading'] is True, 'Threading layer $1 '\
'is not supported';\
print('Threading layer $1 is supported')"
python -c "$cmd"
}
if [[ "$TEST_THREADING" ]]; then
if [[ "$TEST_THREADING" == "tbb" ]]; then
check_sysinfo "TBB"
elif [[ "$TEST_THREADING" == "omp" ]]; then
check_sysinfo "OpenMP"
elif [[ "$TEST_THREADING" == "workqueue" ]]; then
check_sysinfo "Workqueue"
else
echo "Unknown threading layer requested: $TEST_THREADING"
exit 1
fi
fi
# Find catchsegv
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
SEGVCATCH=catchsegv
elif [[ "$unamestr" == 'Darwin' ]]; then
SEGVCATCH=""
else
echo Error
fi
# limit CPUs in use on PPC64LE, fork() issues
# occur on high core count systems
archstr=`uname -m`
if [[ "$archstr" == 'ppc64le' ]]; then
TEST_NPROCS=16
fi
# setup SDKROOT on Mac
if [[ $(uname) == "Darwin" ]]; then
export SDKROOT=`pwd`/MacOSX10.10.sdk
fi
# First run Numba's Power-On-Self-Test to make sure testing will likely work
python -m numba.misc.POST
# Now run tests based on the changes identified via git
NUMBA_ENABLE_CUDASIM=1 $SEGVCATCH python -m numba.runtests -b -v -g -m $TEST_NPROCS -- numba.tests
# List the tests found
echo "INFO: All discovered tests:"
python -m numba.runtests -l
# Now run the Numba test suite with sharding
# Note that coverage is run from the checkout dir to match the "source"
# directive in .coveragerc
echo "INFO: Running shard of discovered tests: ($TEST_START_INDEX:$TEST_COUNT)"
if [ "$RUN_COVERAGE" == "yes" ]; then
echo "INFO: Running with coverage"
export PYTHONPATH=.
coverage erase
$SEGVCATCH coverage run runtests.py -b -j "$TEST_START_INDEX:$TEST_COUNT" --exclude-tags='long_running' -m $TEST_NPROCS -- numba.tests
elif [ "$RUN_TYPEGUARD" == "yes" ]; then
echo "INFO: Running with typeguard"
NUMBA_USE_TYPEGUARD=1 NUMBA_ENABLE_CUDASIM=1 PYTHONWARNINGS="ignore:::typeguard" $SEGVCATCH python runtests.py -b -j "$TEST_START_INDEX:$TEST_COUNT" --exclude-tags='long_running' -m $TEST_NPROCS -- numba.tests
else
NUMBA_ENABLE_CUDASIM=1 $SEGVCATCH python -m numba.runtests -b -j "$TEST_START_INDEX:$TEST_COUNT" --exclude-tags='long_running' -m $TEST_NPROCS -- numba.tests
fi
|