forked from rapidsai/cudf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·194 lines (155 loc) · 5.91 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·194 lines (155 loc) · 5.91 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/bin/bash
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
#########################################
# cuDF GPU build and test script for CI #
#########################################
set -e
NUMARGS=$#
ARGS=$*
# Logger function for build status output
function logger() {
echo -e "\n>>>> $@\n"
}
# Arg parsing function
function hasArg {
(( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
}
# Set path and build parallel level
export PATH=/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=4
export CUDA_REL=${CUDA_VERSION%.*}
export HOME="$WORKSPACE"
# Parse git describe
cd "$WORKSPACE"
export GIT_DESCRIBE_TAG=`git describe --tags`
export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
# Set Benchmark Vars
export GBENCH_BENCHMARKS_DIR="$WORKSPACE/cpp/build/gbenchmarks/"
# Set `LIBCUDF_KERNEL_CACHE_PATH` environment variable to $HOME/.jitify-cache because
# it's local to the container's virtual file system, and not shared with other CI jobs
# like `/tmp` is.
export LIBCUDF_KERNEL_CACHE_PATH="$HOME/.jitify-cache"
# Dask & Distributed option to install main(nightly) or `conda-forge` packages.
export INSTALL_DASK_MAIN=1
function remove_libcudf_kernel_cache_dir {
EXITCODE=$?
logger "removing kernel cache dir: $LIBCUDF_KERNEL_CACHE_PATH"
rm -rf "$LIBCUDF_KERNEL_CACHE_PATH" || logger "could not rm -rf $LIBCUDF_KERNEL_CACHE_PATH"
exit $EXITCODE
}
trap remove_libcudf_kernel_cache_dir EXIT
mkdir -p "$LIBCUDF_KERNEL_CACHE_PATH" || logger "could not mkdir -p $LIBCUDF_KERNEL_CACHE_PATH"
################################################################################
# SETUP - Check environment
################################################################################
logger "Check environment..."
env
logger "Check GPU usage..."
nvidia-smi
logger "Activate conda env..."
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids
# Enter dependencies to be shown in ASV tooltips.
CUDF_DEPS=(librmm)
LIBCUDF_DEPS=(librmm)
conda install "rmm=$MINOR_VERSION.*" "cudatoolkit=$CUDA_REL" \
"rapids-build-env=$MINOR_VERSION.*" \
"rapids-notebook-env=$MINOR_VERSION.*" \
rapids-pytest-benchmark
# https://docs.rapids.ai/maintainers/depmgmt/
# conda remove -f rapids-build-env rapids-notebook-env
# conda install "your-pkg=1.0.0"
# Install the conda-forge or nightly version of dask and distributed
if [[ "${INSTALL_DASK_MAIN}" == 1 ]]; then
gpuci_logger "gpuci_mamba_retry update dask"
gpuci_mamba_retry update dask
else
gpuci_logger "gpuci_mamba_retry install conda-forge::dask>=2022.02.1 conda-forge::distributed>=2022.02.1 --force-reinstall"
gpuci_mamba_retry install conda-forge::dask>=2022.02.1 conda-forge::distributed>=2022.02.1 --force-reinstall
fi
# Install the master version of streamz
logger "pip install git+https://github.com/python-streamz/streamz.git@master --upgrade --no-deps"
pip install "git+https://github.com/python-streamz/streamz.git@master" --upgrade --no-deps
logger "Check versions..."
python --version
$CC --version
$CXX --version
conda info
conda config --show-sources
conda list --show-channel-urls
################################################################################
# BUILD - Build libcudf, cuDF and dask_cudf from source
################################################################################
logger "Build libcudf..."
"$WORKSPACE/build.sh" clean libcudf cudf dask_cudf benchmarks tests --ptds
################################################################################
# BENCHMARK - Run and parse libcudf and cuDF benchmarks
################################################################################
logger "Running benchmarks..."
#Download GBench results Parser
curl -L https://raw.githubusercontent.com/rapidsai/benchmark/main/parser/GBenchToASV.py --output GBenchToASV.py
###
# Generate Metadata for dependencies
###
# Concatenate dependency arrays, convert to JSON array,
# and remove duplicates.
X=("${CUDF_DEPS[@]}" "${LIBCUDF_DEPS[@]}")
DEPS=$(printf '%s\n' "${X[@]}" | jq -R . | jq -s 'unique')
# Build object with k/v pairs of "dependency:version"
DEP_VER_DICT=$(jq -n '{}')
for DEP in $(echo "${DEPS}" | jq -r '.[]'); do
VER=$(conda list | grep "^${DEP}" | awk '{print $2"-"$3}')
DEP_VER_DICT=$(echo "${DEP_VER_DICT}" | jq -c --arg DEP "${DEP}" --arg VER "${VER}" '. + { ($DEP): $VER }')
done
# Pass in an array of dependencies to get a dict of "dependency:version"
function getReqs() {
local DEPS_ARR=("$@")
local REQS="{}"
for DEP in "${DEPS_ARR[@]}"; do
VER=$(echo "${DEP_VER_DICT}" | jq -r --arg DEP "${DEP}" '.[$DEP]')
REQS=$(echo "${REQS}" | jq -c --arg DEP "${DEP}" --arg VER "${VER}" '. + { ($DEP): $VER }')
done
echo "${REQS}"
}
###
# Run LIBCUDF Benchmarks
###
REQS=$(getReqs "${LIBCUDF_DEPS[@]}")
mkdir -p "$WORKSPACE/tmp/benchmark"
touch "$WORKSPACE/tmp/benchmark/benchmarks.txt"
ls ${GBENCH_BENCHMARKS_DIR} > "$WORKSPACE/tmp/benchmark/benchmarks.txt"
#Disable error aborting while tests run, failed tests will not generate data
logger "Running libcudf GBenchmarks..."
cd ${GBENCH_BENCHMARKS_DIR}
set +e
while read BENCH;
do
nvidia-smi
./${BENCH} --benchmark_out=${BENCH}.json --benchmark_out_format=json
EXITCODE=$?
if [[ ${EXITCODE} != 0 ]]; then
rm ./${BENCH}.json
JOBEXITCODE=1
fi
done < "$WORKSPACE/tmp/benchmark/benchmarks.txt"
set -e
rm "$WORKSPACE/tmp/benchmark/benchmarks.txt"
cd "$WORKSPACE"
mv ${GBENCH_BENCHMARKS_DIR}/*.json "$WORKSPACE/tmp/benchmark/"
python GBenchToASV.py -d "$WORKSPACE/tmp/benchmark/" -t ${S3_ASV_DIR} -n libcudf -b branch-${MINOR_VERSION} -r "${REQS}"
###
# Run Python Benchmarks
###
#REQS=$(getReqs "${CUDF_DEPS[@]}")
#BENCHMARK_META=$(jq -n \
# --arg NODE "${NODE_NAME}" \
# --arg BRANCH "branch-${MINOR_VERSION}" \
# --argjson REQS "${REQS}" '
# {
# "machineName": $NODE,
# "commitBranch": $BRANCH,
# "requirements": $REQS
# }
#')
#echo "Benchmark meta:"
#echo "${BENCHMARK_META}" | jq "."