Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing conda compilers #705

Merged
merged 41 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
15418f2
Testing conda compilers
cjnolet Jun 6, 2022
b06eda7
Removing accidental copy
cjnolet Jun 6, 2022
9a710af
Trying again
cjnolet Jun 6, 2022
cd39cb8
Moving files
cjnolet Jun 6, 2022
2bac7c0
Ignoring
cjnolet Jun 6, 2022
9842c2f
Moving script env up
cjnolet Jun 6, 2022
ecc01c9
Removing some script env properties
cjnolet Jun 6, 2022
e9ca15c
Trying again
cjnolet Jun 6, 2022
5a6a7f0
Consolidate C++ conda recipes and add libraft-tests package (#641)
jjacobelli Jun 3, 2022
9a9e0a8
Avoid shadowing CMAKE_ARGS variable in build.sh (#701)
vyasr Jun 3, 2022
1170606
Testing conda compilers
cjnolet Jun 6, 2022
4dea2c0
Removing accidental copy
cjnolet Jun 6, 2022
72ed039
Trying again
cjnolet Jun 6, 2022
6378adb
Moving files
cjnolet Jun 6, 2022
b3ee076
Ignoring
cjnolet Jun 6, 2022
49f992a
Moving script env up
cjnolet Jun 6, 2022
914ada4
Removing some script env properties
cjnolet Jun 6, 2022
af6b289
Trying again
cjnolet Jun 6, 2022
4deb576
Updates
cjnolet Jun 7, 2022
bc028d2
Test raft
cjnolet Jun 7, 2022
f88a3a5
Enabling sccache in conda recipe
cjnolet Jun 7, 2022
088d73c
changing to the proper directory to run test_raft
cjnolet Jun 7, 2022
0a86bcb
Adding sccache env vars back
cjnolet Jun 7, 2022
9581ed6
Merge branch 'backporting_conda_compilers' into test_conda_compilers
cjnolet Jun 7, 2022
0190e11
Using proper test path
cjnolet Jun 7, 2022
7e8d088
Removing versions
cjnolet Jun 7, 2022
c05a80a
iUpdates
cjnolet Jun 13, 2022
ab6a08a
Temporarily removing dense gtests
cjnolet Jun 14, 2022
903a2d8
iEnabling ccache and explicitly setting libcusparse version
cjnolet Jun 14, 2022
602f0d9
Re-enabling csr to dense test
cjnolet Jun 14, 2022
7408e3a
ienabling ccache in pyraft and pylibraft
cjnolet Jun 14, 2022
235412a
Using sccache
cjnolet Jun 14, 2022
51188f7
iEnabling sccache
cjnolet Jun 14, 2022
76e0885
iAdding libcusparse to host dependencies in libraft-headers
cjnolet Jun 14, 2022
410e36a
Fixes
cjnolet Jun 14, 2022
5a9d8dd
Building pyraft and pylibraft in gpu build after tests (just for docs)
cjnolet Jun 14, 2022
6b2ef92
iMore cleanup
cjnolet Jun 14, 2022
a8929ff
iRemoving explicit build
cjnolet Jun 14, 2022
0c06f30
Explicitly building python packages.
cjnolet Jun 14, 2022
0709f19
iBuilding pyraft and pylibraft in cpu job
cjnolet Jun 14, 2022
4eb5993
iUpates
cjnolet Jun 14, 2022
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
10 changes: 9 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libraft pyraft pylibraft docs tests bench clean -v -g --install --compile-libs --compile-nn --compile-dist --allgpuarch --no-nvtx --show_depr_warn -h --buildfaiss --minimal-deps"
VALIDARGS="clean libraft pyraft pylibraft docs tests bench clean -v -g --install --compile-libs --compile-nn --compile-dist --allgpuarch --sccache --no-nvtx --show_depr_warn -h --buildfaiss --minimal-deps"
HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
Expand All @@ -33,6 +33,7 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"]
and <flag> is:
-v - verbose build mode
-g - build for debug
--sccache - enable sccache
--compile-libs - compile shared libraries for all components
--compile-nn - compile shared library for nn component
--compile-dist - compile shared library for distance component
Expand Down Expand Up @@ -68,6 +69,7 @@ ENABLE_NN_DEPENDENCIES=OFF

ENABLE_thrust_DEPENDENCY=ON

SCCACHE_ARGS=""
NVTX=ON
CLEAN=0
UNINSTALL=0
Expand Down Expand Up @@ -132,6 +134,10 @@ if hasArg --install; then
INSTALL_TARGET="install"
fi

if hasArg --sccache; then
SCCACHE_ARGS="-DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
fi

if hasArg --minimal-deps; then
ENABLE_thrust_DEPENDENCY=OFF
fi
Expand Down Expand Up @@ -165,6 +171,7 @@ fi

if hasArg tests || (( ${NUMARGS} == 0 )); then
BUILD_TESTS=ON
COMPILE_DIST_LIBRARY=ON
ENABLE_NN_DEPENDENCIES=ON
COMPILE_NN_LIBRARY=ON
CMAKE_TARGET="${CMAKE_TARGET};test_raft"
Expand Down Expand Up @@ -250,6 +257,7 @@ if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs || hasArg tests || has
-DRAFT_COMPILE_DIST_LIBRARY=${COMPILE_DIST_LIBRARY} \
-DRAFT_USE_FAISS_STATIC=${BUILD_STATIC_FAISS} \
-DRAFT_ENABLE_thrust_DEPENDENCY=${ENABLE_thrust_DEPENDENCY} \
${SCCACHE_ARGS} \
${EXTRA_CMAKE_ARGS}

if [[ ${CMAKE_TARGET} != "" ]]; then
Expand Down
4 changes: 4 additions & 0 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#########################################
set -e

export SCCACHE_S3_KEY_PREFIX="libraft-$(uname -m)"
export SCCACHE_BUCKET="rapids-sccache"
export SCCACHE_REGION="us-west-2"
export SCCACHE_IDLE_TIMEOUT="32768"
# Set path and build parallel level
# openmpi dir is required on CentOS for finding MPI libs from cmake
if [[ -e /etc/os-release ]] && (grep -qi centos /etc/os-release); then
Expand Down
5 changes: 3 additions & 2 deletions ci/cpu/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export UPLOAD_RAFT=1
export UPLOAD_LIBRAFT=1

if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
#If project flash is not activate, always build both
export BUILD_RAFT=1
export BUILD_LIBRAFT=1
fi

export UPLOAD_LIBRAFT=1
2 changes: 1 addition & 1 deletion ci/cpu/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [[ "$BUILD_LIBRAFT" == "1" && "$UPLOAD_LIBRAFT" == "1" ]]; then
gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing --no-progress ${LIBRAFT_FILES}
fi

if [[ "$BUILD_RAFT" == "1" ]]; then
if [[ "$BUILD_RAFT" == "1" && "$UPLOAD_RAFT" == "1" ]]; then
PYRAFT_FILE=$(conda build --no-build-id --croot ${CONDA_BLD_DIR} -c ${CONDA_LOCAL_CHANNEL} conda/recipes/pyraft --python=$PYTHON --output)
PYLIBRAFT_FILE=$(conda build --no-build-id --croot ${CONDA_BLD_DIR} -c ${CONDA_LOCAL_CHANNEL} conda/recipes/pylibraft --python=$PYTHON --output)
test -e ${PYRAFT_FILE}
Expand Down
45 changes: 32 additions & 13 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash


# Copyright (c) 2020-2022, NVIDIA CORPORATION.
#########################################
# RAFT GPU build and test script for CI #
Expand All @@ -17,12 +19,14 @@ function hasArg {
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-8}
export CUDA_REL=${CUDA_VERSION%.*}
CONDA_ARTIFACT_PATH=${WORKSPACE}/ci/artifacts/raft/cpu/.conda-bld/ # notice there is no `linux-64` here


# Set home to the job's workspace
export HOME="$WORKSPACE"
export HOME=$WORKSPACE

# Parse git describe
cd "$WORKSPACE"
cd $WORKSPACE
export GIT_DESCRIBE_TAG=`git describe --tags`
export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
unset GIT_DESCRIBE_TAG
Expand All @@ -46,13 +50,7 @@ conda activate rapids

# Install pre-built conda packages from previous CI step
gpuci_logger "Install libraft conda packages from CPU job"
CONDA_ARTIFACT_PATH="$WORKSPACE/ci/artifacts/raft/cpu/.conda-bld/" # notice there is no `linux-64` here
gpuci_mamba_retry install -c "${CONDA_ARTIFACT_PATH}" libraft-headers libraft-distance libraft-nn libraft-tests

gpuci_logger "Check compiler versions"
python --version
$CC --version
$CXX --version
gpuci_mamba_retry install -y -c "${CONDA_ARTIFACT_PATH}" libraft-headers libraft-distance libraft-nn

gpuci_logger "Check conda environment"
conda info
Expand All @@ -63,12 +61,24 @@ conda list --show-channel-urls
# BUILD - Build RAFT tests
################################################################################

gpuci_logger "Adding ${CONDA_PREFIX}/lib to LD_LIBRARY_PATH"

export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

#gpuci_logger "Build C++ and Python targets"
## These should link against the existing shared libs
#if hasArg --skip-tests; then
# "$WORKSPACE/build.sh" libraft -v
#else
# "$WORKSPACE/build.sh" libraft tests -v
#fi

gpuci_logger "Build and install Python targets"
CONDA_BLD_DIR="$WORKSPACE/.conda-bld"
gpuci_mamba_retry install boa
gpuci_conda_retry mambabuild --no-build-id --croot "${CONDA_BLD_DIR}" conda/recipes/pyraft -c "${CONDA_ARTIFACT_PATH}" --python="${PYTHON}"
gpuci_conda_retry mambabuild --no-build-id --croot "${CONDA_BLD_DIR}" conda/recipes/pylibraft -c "${CONDA_ARTIFACT_PATH}" --python="${PYTHON}"
gpuci_mamba_retry install -c "${CONDA_BLD_DIR}" -c "${CONDA_ARTIFACT_PATH}" pyraft pylibraft
gpuci_mamba_retry install -y -c "${CONDA_BLD_DIR}" -c "${CONDA_ARTIFACT_PATH}" pyraft pylibraft

gpuci_logger "sccache stats"
sccache --show-stats
Expand All @@ -92,9 +102,17 @@ set +x
gpuci_logger "Check GPU usage"
nvidia-smi

gpuci_logger "GoogleTest for raft"
cd "$WORKSPACE"
GTEST_OUTPUT="xml:$WORKSPACE/test-results/raft_cpp/" "$CONDA_PREFIX/bin/libraft/gtests/test_raft"
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
gpuci_logger "GoogleTest for raft"
set -x
cd $WORKSPACE/cpp/build
GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test_raft
else
# Install pre-built conda packages from previous CI step
gpuci_logger "Install libraft conda packages from CPU job"
gpuci_mamba_retry install -y -c "${CONDA_ARTIFACT_PATH}" libraft-tests
GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" $CONDA_PREFIX/bin/libraft/gtests/test_raft
fi

gpuci_logger "Python pytest for pyraft"
cd "$WORKSPACE/python/raft/raft/test"
Expand All @@ -104,6 +122,7 @@ gpuci_logger "Python pytest for pylibraft"
cd "$WORKSPACE/python/pylibraft/pylibraft/test"
python -m pytest --cache-clear --junitxml="$WORKSPACE/junit-pylibraft.xml" -v -s


if [ "$(arch)" = "x86_64" ]; then
gpuci_logger "Building docs"
gpuci_mamba_retry install "rapids-doc-env=${MINOR_VERSION}.*"
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_distance.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --compile-dist --no-nvtx
./build.sh libraft --install -v --allgpuarch --compile-dist --sccache --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_headers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --no-nvtx
./build.sh libraft --install -v --allgpuarch --sccache --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_nn.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh libraft --install -v --allgpuarch --compile-nn --no-nvtx
./build.sh libraft --install -v --allgpuarch --sccache --compile-nn --no-nvtx
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.

./build.sh tests bench -v --allgpuarch --no-nvtx
./build.sh tests bench -v --allgpuarch --sccache --no-nvtx
cmake --install cpp/build --component testing
15 changes: 15 additions & 0 deletions conda/recipes/libraft/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
c_compiler_version:
- 9

cxx_compiler_version:
- 9

cuda_compiler:
- nvcc

sysroot_version:
- "2.17"

cmake_version:
- ">=3.20.1,!=3.23.0"

Expand All @@ -10,5 +22,8 @@ gtest_version:
libcusolver_version:
- ">=11.2.1"

libcusparse_version:
- ">=11.5.0"

libfaiss_version:
- "1.7.0 *_cuda"
63 changes: 43 additions & 20 deletions conda/recipes/libraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,46 @@ package:
source:
git_url: ../../..

build:
script_env:
- PARALLEL_LEVEL
- VERSION_SUFFIX
- PROJECT_FLASH
- CMAKE_GENERATOR
- SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64]
- SCCACHE_BUCKET=rapids-sccache
- SCCACHE_REGION=us-west-2
- SCCACHE_IDLE_TIMEOUT=32768

outputs:
- name: libraft-headers
version: {{ version }}
script: build_libraft_headers.sh
build:
script_env: &script_env
- CC
- CXX
- CUDAHOSTCXX
- PARALLEL_LEVEL
- VERSION_SUFFIX
- PROJECT_FLASH
- CMAKE_GENERATOR
- CMAKE_C_COMPILER_LAUNCHER
- CMAKE_CXX_COMPILER_LAUNCHER
- CMAKE_CUDA_COMPILER_LAUNCHER
- SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64]
- SCCACHE_BUCKET=rapids-sccache
- SCCACHE_REGION=us-west-2
- SCCACHE_IDLE_TIMEOUT=32768
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
- {{ compiler('cuda') }}
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- sysroot_{{ target_platform }} {{ sysroot_version }}
- cmake {{ cmake_version }}
host:
- cudatoolkit {{ cuda_version }}.*
- libcusolver {{ libcusolver_version }}
- libcusparse {{ libcusparse_version }}
- librmm {{ minor_version }}
- nccl {{ nccl_version }}
- ucx-proc=*=gpu
- ucx-py {{ ucx_py_version }}
run:
- cudatoolkit {{ cuda_spec }}
- libcusolver {{ libcusolver_version }}
- libcusparse {{ libcusparse_version }}
- librmm {{ minor_version }}
- nccl {{ nccl_version }}
- ucx-proc=*=gpu
Expand All @@ -65,10 +69,15 @@ outputs:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env: *script_env
ignore_run_exports_from:
- {{ compiler('cuda') }}
requirements:
build:
- cmake {{ cmake_version }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit {{ cuda_version }}.*
- librmm {{ minor_version }}
Expand All @@ -78,11 +87,12 @@ outputs:
- {{ pin_subpackage('libraft-headers', exact=True) }}
run:
- cudatoolkit {{ cuda_spec }}
- libcusolver {{ libcusolver_version }}
- librmm {{ minor_version }}
- nccl {{ nccl_version }}
- ucx-proc=*=gpu
- ucx-py {{ ucx_py_version }}
- libcusolver {{ libcusolver_version }}
- libcusparse {{ libcusparse_version }}
- {{ pin_subpackage('libraft-headers', exact=True) }}
about:
home: http://rapids.ai/
Expand All @@ -94,10 +104,15 @@ outputs:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env: *script_env
ignore_run_exports_from:
- {{ compiler('cuda') }}
requirements:
build:
- cmake {{ cmake_version }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit {{ cuda_version }}.*
- faiss-proc=*=cuda
Expand All @@ -109,6 +124,7 @@ outputs:
- cudatoolkit {{ cuda_spec }}
- faiss-proc=*=cuda
- libcusolver {{ libcusolver_version }}
- libcusparse {{ libcusparse_version }}
- libfaiss {{ libfaiss_version }}
- librmm {{ minor_version }}
- {{ pin_subpackage('libraft-headers', exact=True) }}
Expand All @@ -122,10 +138,15 @@ outputs:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env: *script_env
ignore_run_exports_from:
- {{ compiler('cuda') }}
requirements:
build:
- cmake {{ cmake_version }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit {{ cuda_version }}.*
- gmock {{ gtest_version }}
Expand All @@ -137,6 +158,8 @@ outputs:
- cudatoolkit {{ cuda_spec }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
- libcusolver {{ libcusolver_version }}
- libcusparse {{ libcusparse_version }}
- {{ pin_subpackage('libraft-distance', exact=True) }}
- {{ pin_subpackage('libraft-headers', exact=True) }}
- {{ pin_subpackage('libraft-nn', exact=True) }}
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/pylibraft/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#!/usr/bin/env bash

# This assumes the script is executed from the root of the repo directory
./build.sh pylibraft --install --no-nvtx
./build.sh pylibraft --install --sccache --no-nvtx
14 changes: 14 additions & 0 deletions conda/recipes/pylibraft/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
c_compiler_version:
- 9

cxx_compiler_version:
- 9

cuda_compiler:
- nvcc

sysroot_version:
- "2.17"

cmake_version:
- ">=3.20.1,!=3.23.0"
Loading