Skip to content

Commit

Permalink
Add compute-sanitizer github workflow action to nightly tests (#12800)
Browse files Browse the repository at this point in the history
Adds github workflow action to the nightly tests for running `compute-sanitizer` on the libcudf gtests.

Reference: #12530

Authors:
  - David Wendt (https://github.com/davidwendt)
  - AJ Schmidt (https://github.com/ajschmidt8)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Bradley Dice (https://github.com/bdice)

URL: #12800
  • Loading branch information
davidwendt authored Feb 23, 2023
1 parent f076905 commit fffdc0c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 29 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
conda-cpp-memcheck-tests:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
node_type: "gpu-latest-1"
arch: "amd64"
container_image: "rapidsai/ci:latest"
run_script: "ci/test_cpp_memcheck.sh"
conda-python-cudf-tests:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
Expand Down
30 changes: 1 addition & 29 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

set -euo pipefail

. /opt/conda/etc/profile.d/conda.sh

rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file_key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee env.yaml

rapids-mamba-retry env create --force -f env.yaml -n test

# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libcudf libcudf_kafka libcudf-tests

rapids-logger "Check GPU usage"
nvidia-smi
source "$(dirname "$0")/test_cpp_common.sh"

EXITCODE=0
trap "EXITCODE=1" ERR
Expand Down
32 changes: 32 additions & 0 deletions ci/test_cpp_common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

set -euo pipefail

. /opt/conda/etc/profile.d/conda.sh

rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file_key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee env.yaml

rapids-mamba-retry env create --force -f env.yaml -n test

# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libcudf libcudf_kafka libcudf-tests

rapids-logger "Check GPU usage"
nvidia-smi
25 changes: 25 additions & 0 deletions ci/test_cpp_memcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

source "$(dirname "$0")/test_cpp_common.sh"

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

# 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,libcudf_kafka}/* ; 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

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- cmake>=3.23.1,!=3.25.0
- cubinlinker
- cuda-python>=11.7.1,<12.0
- cuda-sanitizer-api=11.8.86
- cudatoolkit=11.8
- cupy>=9.5.0,<12.0.0a0
- cxx-compiler
Expand Down
12 changes: 12 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ files:
- notebooks
- py_version
- run
- test_cpp
- test_python
test_cpp:
output: none
includes:
- cudatoolkit
- libidentify_stream_usage_build
- test_cpp
test_python:
output: none
includes:
Expand Down Expand Up @@ -266,6 +268,16 @@ dependencies:
arch: aarch64
packages:
- cupy-cuda11x -f https://pip.cupy.dev/aarch64 # TODO: Verify that this works.
test_cpp:
specific:
- output_types: conda
matrices:
- matrix:
cuda: "11.8"
packages:
- cuda-sanitizer-api=11.8.86
- matrix:
packages:
test_java:
common:
- output_types: conda
Expand Down

0 comments on commit fffdc0c

Please sign in to comment.