Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-22.02' into non-owning-…
Browse files Browse the repository at this point in the history
…cuda-async-mr
  • Loading branch information
fkallen committed Nov 12, 2021
2 parents d42e54f + 7b6658e commit 2a03700
Show file tree
Hide file tree
Showing 53 changed files with 803 additions and 78 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# RMM 22.02.00 (Date TBD)

Please see https://github.com/rapidsai/rmm/releases/tag/v22.02.00a for the latest changes to this development branch.

# RMM 21.12.00 (Date TBD)

Please see https://github.com/rapidsai/rmm/releases/tag/v21.12.00a for the latest changes to this development branch.
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR)

file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.02/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)

Expand All @@ -25,7 +25,7 @@ include(rapids-find)

project(
RMM
VERSION 21.12.00
VERSION 22.02.00
LANGUAGES CXX)

# Write the version header
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function(ConfigureBench BENCH_NAME)
target_compile_definitions(${BENCH_NAME} PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM)
endif()

if(DEFINED CUDA_MALLOC_ASYNC_SUPPORT AND NOT CUDA_MALLOC_ASYNC_SUPPORT)
target_compile_definitions(${TEST_NAME} PUBLIC "RMM_DISABLE_CUDA_MALLOC_ASYNC")
endif()

target_compile_options(${BENCH_NAME} PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang>:-Wall -Werror
-Wno-error=deprecated-declarations>)
if(DISABLE_DEPRECATION_WARNING)
Expand Down
64 changes: 50 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ARGS=$*
# script, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean librmm rmm -v -g -n -s --ptds -h"
HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [-h]
VALIDARGS="clean librmm rmm -v -g -n -s --ptds --no-cudamallocasync -h"
HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [--no-cudamallocasync] [--cmake-args=\"<args>\"] [-h]
clean - remove all existing build artifacts and configuration (start over)
librmm - build and install the librmm C++ code
rmm - build and install the rmm Python package
Expand All @@ -28,6 +28,8 @@ HELP="$0 [clean] [librmm] [rmm] [-v] [-g] [-n] [-s] [--ptds] [-h]
-n - no install step
-s - statically link against cudart
--ptds - enable per-thread default stream
--no-cudamallocasync - disable CUDA malloc async support
--cmake-args=\\\"<args>\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument)
-h - print this text
default action (no args) is to build and install 'librmm' and 'rmm' targets
Expand All @@ -42,6 +44,7 @@ BUILD_TYPE=Release
INSTALL_TARGET=install
CUDA_STATIC_RUNTIME=OFF
PER_THREAD_DEFAULT_STREAM=OFF
CUDA_MALLOC_ASYNC_SUPPORT=ON
RAN_CMAKE=0

# Set defaults for vars that may not have been defined externally
Expand All @@ -54,16 +57,42 @@ function hasArg {
(( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
}

function cmakeArgs {
# Check for multiple cmake args options
if [[ $(echo $ARGS | { grep -Eo "\-\-cmake\-args" || true; } | wc -l ) -gt 1 ]]; then
echo "Multiple --cmake-args options were provided, please provide only one: ${ARGS}"
exit 1
fi

# Check for cmake args option
if [[ -n $(echo $ARGS | { grep -E "\-\-cmake\-args" || true; } ) ]]; then
# There are possible weird edge cases that may cause this regex filter to output nothing and fail silently
# the true pipe will catch any weird edge cases that may happen and will cause the program to fall back
# on the invalid option error
CMAKE_ARGS=$(echo $ARGS | { grep -Eo "\-\-cmake\-args=\".+\"" || true; })
if [[ -n ${CMAKE_ARGS} ]]; then
# Remove the full CMAKE_ARGS argument from list of args so that it passes validArgs function
ARGS=${ARGS//$CMAKE_ARGS/}
# Filter the full argument down to just the extra string that will be added to cmake call
CMAKE_ARGS=$(echo $CMAKE_ARGS | grep -Eo "\".+\"" | sed -e 's/^"//' -e 's/"$//')
fi
fi
}


# Runs cmake if it has not been run already for build directory
# LIBRMM_BUILD_DIR
function ensureCMakeRan {
mkdir -p "${LIBRMM_BUILD_DIR}"
if (( RAN_CMAKE == 0 )); then
echo "Executing cmake for librmm..."
cmake -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
cmake -B "${LIBRMM_BUILD_DIR}" -S . \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
-DCUDA_STATIC_RUNTIME="${CUDA_STATIC_RUNTIME}" \
-DPER_THREAD_DEFAULT_STREAM="${PER_THREAD_DEFAULT_STREAM}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B "${LIBRMM_BUILD_DIR}" -S .
-DCUDA_MALLOC_ASYNC_SUPPORT="${CUDA_MALLOC_ASYNC_SUPPORT}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
${CMAKE_ARGS}
RAN_CMAKE=1
fi
}
Expand All @@ -74,12 +103,14 @@ if hasArg -h; then
fi

# Check for valid usage
if (( NUMARGS != 0 )); then
if (( ${NUMARGS} != 0 )); then
# Check for cmake args
cmakeArgs
for a in ${ARGS}; do
if ! (echo " ${VALIDARGS} " | grep -q " ${a} "); then
echo "Invalid option: ${a}"
exit 1
fi
if ! (echo " ${VALIDARGS} " | grep -q " ${a} "); then
echo "Invalid option or formatting, check --help: ${a}"
exit 1
fi
done
fi

Expand All @@ -100,6 +131,9 @@ fi
if hasArg --ptds; then
PER_THREAD_DEFAULT_STREAM=ON
fi
if hasArg --no-cudamallocasync; then
CUDA_MALLOC_ASYNC_SUPPORT=OFF
fi

# If clean given, run it prior to any other steps
if hasArg clean; then
Expand Down Expand Up @@ -131,14 +165,16 @@ fi
if (( NUMARGS == 0 )) || hasArg rmm; then
cd "${REPODIR}/python"
export INSTALL_PREFIX
if [[ ${INSTALL_TARGET} != "" ]]; then
echo "building rmm..."
echo "building rmm..."
if [[ ${CUDA_MALLOC_ASYNC_SUPPORT} == OFF ]]; then
python setup.py build_ext_no_async --inplace
else
python setup.py build_ext --inplace
fi

if [[ ${INSTALL_TARGET} != "" ]]; then
echo "installing rmm..."
python setup.py install --single-version-externally-managed --record=record.txt
else
echo "building rmm..."
python setup.py build_ext --inplace
fi

fi
14 changes: 8 additions & 6 deletions ci/cpu/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ fi

gpuci_logger "Get conda file output locations"

export LIBRMM_FILE=`conda build conda/recipes/librmm --output`
export RMM_FILE=`conda build conda/recipes/rmm --python=$PYTHON --output`
export LIBRMM_FILE=$(conda build conda/recipes/librmm --output)
export RMM_FILES=$(conda build conda/recipes/rmm --python=$PYTHON --output)

################################################################################
# UPLOAD - Conda packages
Expand All @@ -46,9 +46,11 @@ if [[ "$BUILD_LIBRMM" == "1" && "$UPLOAD_LIBRMM" == "1" ]]; then
fi

if [[ "$BUILD_RMM" == "1" && "$UPLOAD_RMM" == "1" ]]; then
test -e ${RMM_FILE}
echo "Upload rmm"
echo ${RMM_FILE}
gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${RMM_FILE} --no-progress
while read -r RMM_FILE; do
test -e ${RMM_FILE}
echo "Upload rmm"
echo ${RMM_FILE}
gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${RMM_FILE} --no-progress
done <<< "${RMM_FILES}"
fi

12 changes: 7 additions & 5 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export HOME=$WORKSPACE
cd $WORKSPACE

# Determine CUDA release version
export CUDA_REL=${CUDA_VERSION%.*}
export CUDA_MAJOR_VER=$(echo "${CUDA_VERSION}" | cut -f 1 -d.)
export CUDA_MINOR_VER=$(echo "${CUDA_VERSION}" | cut -f 2 -d.)
export CUDA_REL="${CUDA_MAJOR_VER}.${CUDA_MINOR_VER}"

# Get latest tag and number of commits since tag
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
Expand All @@ -46,7 +48,7 @@ gpuci_mamba_retry install -y \
"cudatoolkit=$CUDA_REL" \
"rapids-build-env=${MINOR_VERSION}.*"

# https://docs.rapids.ai/maintainers/depmgmt/
# https://docs.rapids.ai/maintainers/depmgmt/
# conda remove --force rapids-build-env
# gpuci_mamba_retry install "your-pkg=1.0.0"

Expand Down Expand Up @@ -110,18 +112,18 @@ else
done

cd $WORKSPACE/python

CONDA_FILE=`find $WORKSPACE/ci/artifacts/rmm/cpu/conda-bld/ -name "librmm*.tar.bz2"`
CONDA_FILE=`basename "$CONDA_FILE" .tar.bz2` #get filename without extension
CONDA_FILE=${CONDA_FILE//-/=} #convert to conda install
gpuci_logger "Installing $CONDA_FILE"
gpuci_mamba_retry install -c $WORKSPACE/ci/artifacts/rmm/cpu/conda-bld/ "$CONDA_FILE"

export LIBRMM_BUILD_DIR="$WORKSPACE/ci/artifacts/rmm/cpu/conda_work/build"

gpuci_logger "Building rmm"
"$WORKSPACE/build.sh" -v rmm

gpuci_logger "pytest rmm"
py.test --cache-clear --junitxml=${WORKSPACE}/test-results/junit-rmm.xml -v --cov-config=.coveragerc --cov=rmm --cov-report=xml:${WORKSPACE}/python/rmm-coverage.xml --cov-report term
exitcode=$?
Expand Down
3 changes: 1 addition & 2 deletions cmake/thirdparty/get_spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
function(find_and_configure_spdlog)

include(${rapids-cmake-dir}/cpm/spdlog.cmake)
rapids_cpm_spdlog()
rapids_cpm_spdlog(INSTALL_EXPORT_SET rmm-exports)

if(spdlog_ADDED)
install(TARGETS spdlog_header_only EXPORT rmm-exports)
else()
rapids_export_package(BUILD spdlog rmm-exports)
rapids_export_package(INSTALL spdlog rmm-exports)
endif()
endfunction()

Expand Down
1 change: 1 addition & 0 deletions conda/environments/rmm_dev_cuda10.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- cudatoolkit=10.1
- spdlog>=1.8.5,<1.9
- cython>=0.29,<0.30
- gcovr>=5.0
1 change: 1 addition & 0 deletions conda/environments/rmm_dev_cuda10.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- cudatoolkit=10.2
- spdlog>=1.8.5,<1.9
- cython>=0.29,<0.30
- gcovr>=5.0
1 change: 1 addition & 0 deletions conda/environments/rmm_dev_cuda11.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- cudatoolkit=11.0
- spdlog>=1.8.5,<1.9
- cython>=0.29,<0.30
- gcovr>=5.0
2 changes: 1 addition & 1 deletion conda/recipes/librmm/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2019, NVIDIA CORPORATION.

# This assumes the script is executed from the root of the repo directory
./build.sh -v clean librmm
./build.sh -v clean librmm --cmake-args=\"-DCMAKE_INSTALL_LIBDIR=lib\"
6 changes: 4 additions & 2 deletions conda/recipes/librmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set cuda_version='.'.join(environ.get('CUDA', '9.2').split('.')[:2]) %}
{% set cuda_major=cuda_version.split('.')[0] %}

package:
name: librmm
version: {{ version }}
Expand All @@ -11,7 +13,7 @@ source:

build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env:
- CC
- CXX
Expand All @@ -34,8 +36,8 @@ requirements:
host:
- cudatoolkit {{ cuda_version }}.*
run:
- {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
- spdlog>=1.8.5,<1.9
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}

test:
commands:
Expand Down
7 changes: 6 additions & 1 deletion conda/recipes/rmm/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Copyright (c) 2018-2019, NVIDIA CORPORATION.

# Script assumes the script is executed from the root of the repo directory
./build.sh -v clean rmm
BUILD_FLAGS=""
if [ "${cudaMallocAsync}" == "no_cma" ]; then
BUILD_FLAGS="${BUILD_FLAGS} --no-cudamallocasync"
fi

./build.sh -v clean rmm ${BUILD_FLAGS}
3 changes: 3 additions & 0 deletions conda/recipes/rmm/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cudaMallocAsync:
- has_cma
- no_cma
9 changes: 7 additions & 2 deletions conda/recipes/rmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set py_version=environ.get('CONDA_PY', 35) %}
{% set cuda_version='.'.join(environ.get('CUDA', '10.1').split('.')[:2]) %}
{% set cuda_major=cuda_version.split('.')[0] %}

package:
name: rmm
Expand All @@ -13,7 +14,7 @@ source:

build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda_{{ cuda_version }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}_{{ cudaMallocAsync }}
script_env:
- RMM_BUILD_NO_GPU_TEST
- VERSION_SUFFIX
Expand All @@ -33,7 +34,11 @@ requirements:
- python
- numba >=0.49
- numpy
- {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
{% if cudaMallocAsync == "has_cma" %}
- {{ pin_compatible('cudatoolkit', max_pin='x', lower_bound='11.2') }} # cudatoolkit >=11.2,<12.0.0
{% else %}
- {{ pin_compatible('cudatoolkit', upper_bound='11.2', lower_bound='11.0') }} # cudatoolkit >=11.0,<11.2
{% endif %}

test:
commands:
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "RMM"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 21.12
PROJECT_NUMBER = 22.02

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 4 additions & 0 deletions gcovr.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exclude=build/.*
exclude=tests/.*
html=yes
html-details=yes
Loading

0 comments on commit 2a03700

Please sign in to comment.