diff --git a/ci/run_cudf_benchmark_smoketests.sh b/ci/run_cudf_benchmark_smoketests.sh new file mode 100755 index 00000000000..56e768d68ba --- /dev/null +++ b/ci/run_cudf_benchmark_smoketests.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/benchmarks/libcudf/"; + +# Ensure that benchmarks are runnable +# Run a small Google benchmark +./MERGE_BENCH --benchmark_filter=/2/ +# Run a small nvbench benchmark +./STRINGS_NVBENCH --run-once --benchmark 0 --devices 0 diff --git a/ci/run_cudf_ctests.sh b/ci/run_cudf_ctests.sh new file mode 100755 index 00000000000..562201c11b0 --- /dev/null +++ b/ci/run_cudf_ctests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/"; + +ctest --output-on-failure --no-tests=error "$@" diff --git a/ci/run_cudf_kafka_ctests.sh b/ci/run_cudf_kafka_ctests.sh new file mode 100755 index 00000000000..51e5e302a68 --- /dev/null +++ b/ci/run_cudf_kafka_ctests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf_kafka/"; + +ctest --output-on-failure --no-tests=error "$@" diff --git a/ci/run_cudf_memcheck_ctests.sh b/ci/run_cudf_memcheck_ctests.sh new file mode 100755 index 00000000000..cfd12cb92b4 --- /dev/null +++ b/ci/run_cudf_memcheck_ctests.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -uo pipefail + +EXITCODE=0 +trap "EXITCODE=1" ERR + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/"; + +export GTEST_CUDF_RMM_MODE=cuda +for gt in ./*_TEST ; do + test_name=$(basename ${gt}) + # Run gtests with compute-sanitizer + if [[ "$test_name" == "ERROR_TEST" ]] || [[ "$test_name" == "STREAM_IDENTIFICATION_TEST" ]]; then + continue + fi + echo "Running compute-sanitizer on $test_name" + compute-sanitizer --tool memcheck ${gt} "$@" +done +unset GTEST_CUDF_RMM_MODE + +exit ${EXITCODE} diff --git a/ci/run_cudf_pandas_pytest_benchmarks.sh b/ci/run_cudf_pandas_pytest_benchmarks.sh new file mode 100755 index 00000000000..d3ab387a612 --- /dev/null +++ b/ci/run_cudf_pandas_pytest_benchmarks.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_cudf_pandas_pytest_benchmarks.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/ + +CUDF_BENCHMARKS_USE_PANDAS=ON \ +CUDF_BENCHMARKS_DEBUG_ONLY=ON \ +pytest --cache-clear "$@" benchmarks diff --git a/ci/run_cudf_pytest_benchmarks.sh b/ci/run_cudf_pytest_benchmarks.sh new file mode 100755 index 00000000000..5e9b537f2b0 --- /dev/null +++ b/ci/run_cudf_pytest_benchmarks.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_cudf_pytest_benchmarks.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/ + +CUDF_BENCHMARKS_DEBUG_ONLY=ON \ +pytest --cache-clear "$@" benchmarks diff --git a/ci/run_cudf_pytests.sh b/ci/run_cudf_pytests.sh new file mode 100755 index 00000000000..2b7b71b5132 --- /dev/null +++ b/ci/run_cudf_pytests.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_cudf_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/cudf/ + +pytest --cache-clear --ignore="benchmarks" "$@" tests diff --git a/ci/run_custreamz_pytests.sh b/ci/run_custreamz_pytests.sh new file mode 100755 index 00000000000..53e27ec64b3 --- /dev/null +++ b/ci/run_custreamz_pytests.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_custreamz_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/custreamz/custreamz/ + +pytest --cache-clear "$@" tests diff --git a/ci/run_dask_cudf_pytests.sh b/ci/run_dask_cudf_pytests.sh new file mode 100755 index 00000000000..07658c6d234 --- /dev/null +++ b/ci/run_dask_cudf_pytests.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_dask_cudf_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/dask_cudf/dask_cudf/ + +pytest --cache-clear "$@" . diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 7119a79f4de..995c8d7d71f 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -1,7 +1,10 @@ #!/bin/bash # Copyright (c) 2022-2024, NVIDIA CORPORATION. -source "$(dirname "$0")/test_cpp_common.sh" +# Support invoking test_cpp.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ + +source ./ci/test_cpp_common.sh EXITCODE=0 trap "EXITCODE=1" ERR @@ -10,36 +13,23 @@ set +e # Run libcudf and libcudf_kafka gtests from libcudf-tests package export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/ -pushd $CONDA_PREFIX/bin/gtests/libcudf/ rapids-logger "Run libcudf gtests" -ctest -j20 --output-on-failure --no-tests=error +./ci/run_cudf_ctests.sh -j20 SUITEERROR=$? -popd if (( ${SUITEERROR} == 0 )); then - pushd $CONDA_PREFIX/bin/gtests/libcudf_kafka/ rapids-logger "Run libcudf_kafka gtests" - ctest -j20 --output-on-failure --no-tests=error + ./ci/run_cudf_kafka_ctests.sh -j20 SUITEERROR=$? - popd fi # Ensure that benchmarks are runnable -pushd $CONDA_PREFIX/bin/benchmarks/libcudf/ rapids-logger "Run tests of libcudf benchmarks" if (( ${SUITEERROR} == 0 )); then - # Run a small Google benchmark - ./MERGE_BENCH --benchmark_filter=/2/ - SUITEERROR=$? -fi - -if (( ${SUITEERROR} == 0 )); then - # Run a small nvbench benchmark - ./STRINGS_NVBENCH --run-once --benchmark 0 --devices 0 + ./ci/run_cudf_benchmark_smoketests.sh SUITEERROR=$? fi -popd rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE} diff --git a/ci/test_cpp_memcheck.sh b/ci/test_cpp_memcheck.sh index 0e85268cb72..0233c2b55f8 100755 --- a/ci/test_cpp_memcheck.sh +++ b/ci/test_cpp_memcheck.sh @@ -1,25 +1,16 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. -source "$(dirname "$0")/test_cpp_common.sh" +# Support invoking test_cpp.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ -EXITCODE=0 -trap "EXITCODE=1" ERR -set +e +source ./ci/test_cpp_common.sh -# Run gtests with compute-sanitizer rapids-logger "Memcheck gtests with rmm_mode=cuda" -export GTEST_CUDF_RMM_MODE=cuda -COMPUTE_SANITIZER_CMD="compute-sanitizer --tool memcheck" -for gt in "$CONDA_PREFIX"/bin/gtests/libcudf/*_TEST ; do - test_name=$(basename ${gt}) - if [[ "$test_name" == "ERROR_TEST" ]] || [[ "$test_name" == "STREAM_IDENTIFICATION_TEST" ]]; then - continue - fi - echo "Running compute-sanitizer on $test_name" - ${COMPUTE_SANITIZER_CMD} ${gt} --gtest_output=xml:"${RAPIDS_TESTS_DIR}${test_name}.xml" -done -unset GTEST_CUDF_RMM_MODE + +./ci/run_cudf_memcheck_ctests.sh \ + --gtest_output=xml:"${RAPIDS_TESTS_DIR}${test_name}.xml" \ + && EXITCODE=$? || EXITCODE=$?; rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE} diff --git a/ci/test_python_cudf.sh b/ci/test_python_cudf.sh index bb33d8473ce..ace71bb0b75 100755 --- a/ci/test_python_cudf.sh +++ b/ci/test_python_cudf.sh @@ -1,8 +1,11 @@ #!/bin/bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. + +# Support invoking test_python_cudf.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../; # Common setup steps shared by Python test jobs -source "$(dirname "$0")/test_python_common.sh" +source ./ci/test_python_common.sh rapids-logger "Check GPU usage" nvidia-smi @@ -12,51 +15,37 @@ trap "EXITCODE=1" ERR set +e rapids-logger "pytest cudf" -pushd python/cudf/cudf -# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level. -pytest \ - --cache-clear \ - --ignore="benchmarks" \ +./ci/run_cudf_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cudf.xml" \ --numprocesses=8 \ --dist=loadscope \ --cov-config=../.coveragerc \ --cov=cudf \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-coverage.xml" \ - --cov-report=term \ - tests -popd + --cov-report=term # Run benchmarks with both cudf and pandas to ensure compatibility is maintained. # Benchmarks are run in DEBUG_ONLY mode, meaning that only small data sizes are used. # Therefore, these runs only verify that benchmarks are valid. # They do not generate meaningful performance measurements. -pushd python/cudf + rapids-logger "pytest for cudf benchmarks" -CUDF_BENCHMARKS_DEBUG_ONLY=ON \ -pytest \ - --cache-clear \ +./ci/run_cudf_pytest_benchmarks.sh \ --numprocesses=8 \ --dist=loadscope \ --cov-config=.coveragerc \ --cov=cudf \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-benchmark-coverage.xml" \ - --cov-report=term \ - benchmarks + --cov-report=term rapids-logger "pytest for cudf benchmarks using pandas" -CUDF_BENCHMARKS_USE_PANDAS=ON \ -CUDF_BENCHMARKS_DEBUG_ONLY=ON \ -pytest \ - --cache-clear \ +./ci/run_cudf_pandas_pytest_benchmarks.sh \ --numprocesses=8 \ --dist=loadscope \ --cov-config=.coveragerc \ --cov=cudf \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-benchmark-pandas-coverage.xml" \ - --cov-report=term \ - benchmarks -popd + --cov-report=term rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE} diff --git a/ci/test_python_other.sh b/ci/test_python_other.sh index 25c1d681029..bc15747b26a 100755 --- a/ci/test_python_other.sh +++ b/ci/test_python_other.sh @@ -1,8 +1,11 @@ #!/bin/bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. + +# Support invoking test_python_cudf.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ # Common setup steps shared by Python test jobs -source "$(dirname "$0")/test_python_common.sh" +source ./ci/test_python_common.sh rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ @@ -17,32 +20,24 @@ trap "EXITCODE=1" ERR set +e rapids-logger "pytest dask_cudf" -pushd python/dask_cudf/dask_cudf -pytest \ - --cache-clear \ +./ci/run_dask_cudf_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-dask-cudf.xml" \ --numprocesses=8 \ --dist=loadscope \ --cov-config=../.coveragerc \ --cov=dask_cudf \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/dask-cudf-coverage.xml" \ - --cov-report=term \ - . -popd + --cov-report=term rapids-logger "pytest custreamz" -pushd python/custreamz/custreamz -pytest \ - --cache-clear \ +./ci/run_custreamz_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-custreamz.xml" \ --numprocesses=8 \ --dist=loadscope \ --cov-config=../.coveragerc \ --cov=custreamz \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/custreamz-coverage.xml" \ - --cov-report=term \ - tests -popd + --cov-report=term rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE}