Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ If you want to manage all run-time dependencies yourself, also pass the `--no-de

## Running tests

Tests must be run from the `testing` folder, which contains the pytest
configuration and code to generate binaries used during the tests. The test
binaries need to be built on the system on which the tests are run, so that
they are compiled for the appropriate compute capability.

```
pytest -n auto --pyargs numba.cuda.tests -v
cd testing
# Optionally, build test binaries and point to their location for the test suite
make
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`
# Execute tests
pytest -n auto -v
```


Expand Down
5 changes: 4 additions & 1 deletion ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ pip install nvidia-sphinx-theme

rapids-print-env

# Change out of the root of the repo early so the source tree in the repo
# doesn't confuse things
pushd docs

rapids-logger "Show Numba system info"
python -m numba --sysinfo

Expand All @@ -41,7 +45,6 @@ trap "EXITCODE=1" ERR
set +e

rapids-logger "Build docs"
pushd docs
make html

popd
Expand Down
19 changes: 3 additions & 16 deletions ci/coverage_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,19 @@ python -m pip install \
pytest-cov \
coverage

GET_TEST_BINARY_DIR="
import numba_cuda
root = numba_cuda.__file__.rstrip('__init__.py')
test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
print(test_dir)
"

rapids-logger "Build tests"

export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$GET_TEST_BINARY_DIR")
rapids-logger "Build test binaries"
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
make
popd

rapids-logger "Check GPU usage"
nvidia-smi

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-logger "Show Numba system info"
python -m numba --sysinfo

rapids-logger "Run Tests with Coverage"
python -m pytest --pyargs numba.cuda.tests -v --cov
python -m pytest -v --cov

rapids-logger "Generate Markdown Coverage Report"
python -m coverage report --format markdown >> $GITHUB_STEP_SUMMARY
Expand Down
11 changes: 0 additions & 11 deletions ci/get_test_binary_dir.py

This file was deleted.

24 changes: 6 additions & 18 deletions ci/test_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ set -u

pip install filecheck

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-logger "Check GPU usage"
nvidia-smi

rapids-logger "Build test binaries"
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
make

rapids-logger "Show Numba system info"
python -m numba --sysinfo

Expand All @@ -77,21 +78,8 @@ set +e
rapids-logger "Test importing numba.cuda"
python -c "from numba import cuda"

GET_TEST_BINARY_DIR="
import numba_cuda
root = numba_cuda.__file__.rstrip('__init__.py')
test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
print(test_dir)
"

rapids-logger "Build tests"
export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$GET_TEST_BINARY_DIR")
pushd $NUMBA_CUDA_TEST_BIN_DIR
make
popd

rapids-logger "Run Tests"
pytest --pyargs numba.cuda.tests -v
pytest -v

popd

Expand Down
26 changes: 6 additions & 20 deletions ci/test_conda_ctypes_binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,25 @@ set -u

pip install filecheck

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-logger "Check GPU usage"
nvidia-smi

rapids-logger "Build test binaries"
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
make

rapids-logger "Show Numba system info"
python -m numba --sysinfo

EXITCODE=0
trap "EXITCODE=1" ERR
set +e

rapids-logger "Build tests"

PY_SCRIPT="
import numba_cuda
root = numba_cuda.__file__.rstrip('__init__.py')
test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
print(test_dir)
"

NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT")
pushd $NUMBA_CUDA_TEST_BIN_DIR
make
popd


rapids-logger "Run Tests"
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR pytest --pyargs numba.cuda.tests -v
NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR pytest -v

popd

Expand Down
14 changes: 9 additions & 5 deletions ci/test_simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ set -u

pip install filecheck

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-print-env

# The simulator doesn't actually use the test binaries, but we move into the
# test binaries folder so that we're not in the root of the repo, and therefore
# numba-cuda code from the installed package will be tested, instead of the
# code in the source repo.
rapids-logger "Move to test binaries folder"
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR

rapids-logger "Show Numba system info"
python -m numba --sysinfo

Expand All @@ -46,7 +50,7 @@ set +e

rapids-logger "Run Tests"
export NUMBA_ENABLE_CUDASIM=1
pytest --pyargs numba.cuda.tests -v
pytest -v

popd

Expand Down
7 changes: 4 additions & 3 deletions ci/test_wheel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ python -m pip install "llvmlite<0.45" "numba==0.61.*" # WAR for https://github.c


rapids-logger "Build tests"
$NUMBA_CUDA_TEST_BIN_DIR = (python ci\get_test_binary_dir.py)
$NUMBA_CUDA_TEST_BIN_DIR = (Join-Path -Path (Get-Location) -ChildPath "testing")
echo "Test binary dir: $NUMBA_CUDA_TEST_BIN_DIR"
pushd $NUMBA_CUDA_TEST_BIN_DIR
Get-Location

cmd.exe /c '.\build.bat'
popd

rapids-logger "Check GPU usage"
nvidia-smi
Expand All @@ -51,4 +50,6 @@ rapids-logger "Show Numba system info"
python -m numba --sysinfo

rapids-logger "Run Tests"
python -m pytest --pyargs numba.cuda.tests -v
python -m pytest -v

popd
22 changes: 5 additions & 17 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,21 @@ fi

python -m pip install "${DEPENDENCIES[@]}"

rapids-logger "Test importing numba.cuda"
python -c "from numba import cuda"

GET_TEST_BINARY_DIR="
import numba_cuda
root = numba_cuda.__file__.rstrip('__init__.py')
test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
print(test_dir)
"

rapids-logger "Build tests"
export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$GET_TEST_BINARY_DIR")
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
make
popd

rapids-logger "Test importing numba.cuda"
python -c "from numba import cuda"

rapids-logger "Check GPU usage"
nvidia-smi

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-logger "Show Numba system info"
python -m numba --sysinfo

rapids-logger "Run Tests"
python -m pytest --pyargs numba.cuda.tests -v
python -m pytest -v

popd
23 changes: 7 additions & 16 deletions ci/test_wheel_ctypes_binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,22 @@ python -m pip install \

# FIXME: Find a way to build the tests that does not depend on the CUDA Python bindings
#rapids-logger "Build tests"
#PY_SCRIPT="
#import numba_cuda
#root = numba_cuda.__file__.rstrip('__init__.py')
#test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
#print(test_dir)
#"
#
#NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT")
#pushd $NUMBA_CUDA_TEST_BIN_DIR
#NUMBA_CUDA_USE_NVIDIA_BINDING=0 make
#popd
rapids-logger "Copy and cd into test binaries dir"
export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
# make

# Prevent the testsuite trying to use the test binaries
unset NUMBA_CUDA_TEST_BIN_DIR

rapids-logger "Check GPU usage"
nvidia-smi

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-logger "Show Numba system info"
NUMBA_CUDA_USE_NVIDIA_BINDING=0 python -m numba --sysinfo

rapids-logger "Run Tests"
# NUMBA_CUDA_USE_NVIDIA_BINDING=0 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m pytest --pyargs numba.cuda.tests -v
NUMBA_CUDA_USE_NVIDIA_BINDING=0 python -m pytest --pyargs numba.cuda.tests -v
NUMBA_CUDA_USE_NVIDIA_BINDING=0 python -m pytest -v

popd
19 changes: 4 additions & 15 deletions ci/test_wheel_deps_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,15 @@ echo "Package path: ${package}"
# TODO: control minor version pinning to honor TEST_MATRIX once the cuda-toolkit metapackage is up
python -m pip install "${package}[cu${CUDA_VER_MAJOR},test-cu${CUDA_VER_MAJOR}]"

rapids-logger "Build tests"
PY_SCRIPT="
import numba_cuda
root = numba_cuda.__file__.rstrip('__init__.py')
test_dir = root + \"numba/cuda/tests/test_binary_generation/\"
print(test_dir)
"
NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT")
rapids-logger "Build test binaries"

export NUMBA_CUDA_TEST_BIN_DIR=`pwd`/testing
pushd $NUMBA_CUDA_TEST_BIN_DIR
make
popd


rapids-logger "Check GPU usage"
nvidia-smi

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-logger "Show Numba system info"
python -m numba --sysinfo

Expand All @@ -42,6 +31,6 @@ apt remove --purge `dpkg --get-selections | grep cuda-nvvm | awk '{print $1}'` -
apt remove --purge `dpkg --get-selections | grep cuda-nvrtc | awk '{print $1}'` -y

rapids-logger "Run Tests"
NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m pytest --pyargs numba.cuda.tests -v
NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m pytest -v

popd
Loading