-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit moves some of the logic from the pynvjitlink patch.py into numba-cuda so that it can use pynvjitlink without patching.
- Loading branch information
1 parent
d3abb3a
commit cd94f0d
Showing
18 changed files
with
907 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024, NVIDIA CORPORATION | ||
|
||
set -euo pipefail | ||
|
||
. /opt/conda/etc/profile.d/conda.sh | ||
|
||
if [ "${CUDA_VER%.*.*}" = "11" ]; then | ||
CTK_PACKAGES="cudatoolkit" | ||
else | ||
CTK_PACKAGES="cuda-nvcc-impl cuda-nvrtc" | ||
fi | ||
|
||
rapids-logger "Install testing dependencies" | ||
# TODO: Replace with rapids-dependency-file-generator | ||
rapids-mamba-retry create -n test \ | ||
c-compiler \ | ||
cxx-compiler \ | ||
${CTK_PACKAGES} \ | ||
cuda-python \ | ||
cuda-version=${CUDA_VER%.*} \ | ||
make \ | ||
psutil \ | ||
pytest \ | ||
python=${RAPIDS_PY_VERSION} | ||
|
||
# Temporarily allow unbound variables for conda activation. | ||
set +u | ||
conda activate test | ||
set -u | ||
|
||
rapids-mamba-retry install -c `pwd`/conda-repo numba-cuda | ||
|
||
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 "Show Numba system info" | ||
python -m numba --sysinfo | ||
|
||
EXITCODE=0 | ||
trap "EXITCODE=1" ERR | ||
set +e | ||
|
||
|
||
rapids-logger "Install pynvjitlink" | ||
set +u | ||
rapids-mamba-retry install -c rapidsai pynvjitlink | ||
set -u | ||
|
||
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" | ||
ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v | ||
|
||
popd | ||
|
||
rapids-logger "Test script exiting with value: $EXITCODE" | ||
exit ${EXITCODE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023-2024, NVIDIA CORPORATION | ||
|
||
set -euo pipefail | ||
|
||
rapids-logger "Install testing dependencies" | ||
# TODO: Replace with rapids-dependency-file-generator | ||
python -m pip install \ | ||
psutil \ | ||
cuda-python \ | ||
pytest | ||
|
||
rapids-logger "Install pynvjitlink" | ||
python -m pip install pynvjitlink-cu12 | ||
|
||
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 "Install wheel" | ||
package=$(realpath wheel/numba_cuda*.whl) | ||
echo "Package path: $package" | ||
python -m pip install $package | ||
|
||
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" | ||
ENABLE_PYNVJITLINK=1 NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.