From bcc9030008a84c58e02f4652e5ef103fe13ea898 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Dec 2023 16:23:03 -0600 Subject: [PATCH 1/7] Update to rapids_cpm_cccl. --- cpp/CMakeLists.txt | 10 +++++----- .../thirdparty/{get_thrust.cmake => get_cccl.cmake} | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) rename cpp/cmake/thirdparty/{get_thrust.cmake => get_cccl.cmake} (71%) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index bccbc8c471..687af44fb3 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -177,8 +177,8 @@ include(cmake/modules/ConfigureCUDA.cmake) rapids_cpm_init() if(NOT BUILD_CPU_ONLY) - # thrust before rmm/cuco so we get the right version of thrust/cub - include(cmake/thirdparty/get_thrust.cmake) + # CCCL before rmm/cuco so we get the right version of CCCL + include(cmake/thirdparty/get_cccl.cmake) include(cmake/thirdparty/get_rmm.cmake) include(cmake/thirdparty/get_cutlass.cmake) @@ -206,7 +206,7 @@ target_include_directories( if(NOT BUILD_CPU_ONLY) # Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target. - target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass raft::Thrust) + target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass CCCL::Thrust) endif() target_compile_features(raft INTERFACE cxx_std_17 $) @@ -632,8 +632,8 @@ string( APPEND code_string [=[ -if(NOT TARGET raft::Thrust) - thrust_create_target(raft::Thrust FROM_OPTIONS) +if(NOT TARGET CCCL::Thrust) + thrust_create_target(CCCL::Thrust FROM_OPTIONS) endif() ]=] ) diff --git a/cpp/cmake/thirdparty/get_thrust.cmake b/cpp/cmake/thirdparty/get_cccl.cmake similarity index 71% rename from cpp/cmake/thirdparty/get_thrust.cmake rename to cpp/cmake/thirdparty/get_cccl.cmake index 6e37aab40d..5c3ec76541 100644 --- a/cpp/cmake/thirdparty/get_thrust.cmake +++ b/cpp/cmake/thirdparty/get_cccl.cmake @@ -12,13 +12,12 @@ # the License. # ============================================================================= -# Use CPM to find or clone thrust -function(find_and_configure_thrust) - include(${rapids-cmake-dir}/cpm/thrust.cmake) +# Use CPM to find or clone CCCL +function(find_and_configure_cccl) + include(${rapids-cmake-dir}/cpm/cccl.cmake) - rapids_cpm_thrust( NAMESPACE raft - BUILD_EXPORT_SET raft-exports - INSTALL_EXPORT_SET raft-exports) + rapids_cpm_cccl( BUILD_EXPORT_SET raft-exports + INSTALL_EXPORT_SET raft-exports) endfunction() -find_and_configure_thrust() +find_and_configure_cccl() From 11c859c025ae09089e8d8e10d1e59eca731fcce3 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Dec 2023 15:57:51 -0600 Subject: [PATCH 2/7] Use cuCollections built with CCCL 2.2.0. --- cpp/template/cmake/thirdparty/fetch_rapids.cmake | 2 ++ fetch_rapids.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cpp/template/cmake/thirdparty/fetch_rapids.cmake b/cpp/template/cmake/thirdparty/fetch_rapids.cmake index 15b6c43a6f..ad124375fd 100644 --- a/cpp/template/cmake/thirdparty/fetch_rapids.cmake +++ b/cpp/template/cmake/thirdparty/fetch_rapids.cmake @@ -14,6 +14,8 @@ # Use this variable to update RAPIDS and RAFT versions set(RAPIDS_VERSION "24.02") +set(rapids-cmake-repo bdice/rapids-cmake) +set(rapids-cmake-branch cuco-cccl-2.2.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION}/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index ca871c5759..094304f837 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -11,6 +11,8 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= +set(rapids-cmake-repo bdice/rapids-cmake) +set(rapids-cmake-branch cuco-cccl-2.2.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake From fc560ea3c9b48896cf2f17da3e606c9eba1141b1 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sun, 10 Dec 2023 22:12:14 -0600 Subject: [PATCH 3/7] Use rmm artifacts. --- ci/build_cpp.sh | 6 +++++- ci/build_python.sh | 10 ++++++++++ ci/test_cpp.sh | 2 ++ ci/test_python.sh | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 178ce723a5..5a0b0a9310 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,10 +9,14 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) + version=$(rapids-generate-version) rapids-logger "Begin cpp build" -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libraft +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ + --channel "${LIBRMM_CHANNEL}" \ + conda/recipes/libraft rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 3e67edd5db..8d5a7fc603 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -12,6 +12,8 @@ rapids-print-env rapids-logger "Begin py build" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) +LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) +RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 python) version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) @@ -29,11 +31,15 @@ done rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ + --channel "${RMM_CHANNEL}" \ conda/recipes/pylibraft rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ + --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-dask @@ -41,6 +47,8 @@ rapids-conda-retry mambabuild \ rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ + --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-ann-bench @@ -51,6 +59,8 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ + --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-ann-bench-cpu fi diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 0f8efb171e..14741d4f0f 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -19,6 +19,7 @@ conda activate test set -u CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) +LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/ mkdir -p "${RAPIDS_TESTS_DIR}" @@ -26,6 +27,7 @@ rapids-print-env rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ libraft-headers libraft libraft-tests rapids-logger "Check GPU usage" diff --git a/ci/test_python.sh b/ci/test_python.sh index cb6b7631e4..1a40554a78 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -21,6 +21,8 @@ set -u rapids-logger "Downloading artifacts from previous jobs" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python) +LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) +RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 python) RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"} RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"} @@ -31,6 +33,8 @@ rapids-print-env rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ --channel "${PYTHON_CHANNEL}" \ + --channel "${LIBRMM_CHANNEL}" \ + --channel "${RMM_CHANNEL}" \ libraft libraft-headers pylibraft raft-dask rapids-logger "Check GPU usage" From c8cda27dca54fccaacba9986d27978c41fe9d8fb Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 18 Dec 2023 11:16:14 -0800 Subject: [PATCH 4/7] Remove thrust_create_target. --- cpp/CMakeLists.txt | 10 ---------- cpp/cmake/thirdparty/get_cccl.cmake | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 687af44fb3..f12c0437d8 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -628,16 +628,6 @@ Imported Targets: set(code_string ${nvtx_export_string}) -string( - APPEND - code_string - [=[ -if(NOT TARGET CCCL::Thrust) - thrust_create_target(CCCL::Thrust FROM_OPTIONS) -endif() -]=] -) - string( APPEND code_string diff --git a/cpp/cmake/thirdparty/get_cccl.cmake b/cpp/cmake/thirdparty/get_cccl.cmake index 5c3ec76541..c608ee4630 100644 --- a/cpp/cmake/thirdparty/get_cccl.cmake +++ b/cpp/cmake/thirdparty/get_cccl.cmake @@ -15,9 +15,7 @@ # Use CPM to find or clone CCCL function(find_and_configure_cccl) include(${rapids-cmake-dir}/cpm/cccl.cmake) - - rapids_cpm_cccl( BUILD_EXPORT_SET raft-exports - INSTALL_EXPORT_SET raft-exports) + rapids_cpm_cccl(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports) endfunction() find_and_configure_cccl() From d990bb151365a87762ab05b8cfccf95909c5e74c Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 Dec 2023 07:56:06 -0800 Subject: [PATCH 5/7] Revert testing changes. --- ci/build_cpp.sh | 6 +----- ci/build_python.sh | 10 ---------- ci/test_cpp.sh | 2 -- ci/test_python.sh | 4 ---- cpp/template/cmake/thirdparty/fetch_rapids.cmake | 2 -- fetch_rapids.cmake | 2 -- 6 files changed, 1 insertion(+), 25 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 5a0b0a9310..178ce723a5 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,14 +9,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) - version=$(rapids-generate-version) rapids-logger "Begin cpp build" -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ - --channel "${LIBRMM_CHANNEL}" \ - conda/recipes/libraft +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libraft rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 8d5a7fc603..3e67edd5db 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -12,8 +12,6 @@ rapids-print-env rapids-logger "Begin py build" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) -LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) -RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 python) version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) @@ -31,15 +29,11 @@ done rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ - --channel "${RMM_CHANNEL}" \ conda/recipes/pylibraft rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ - --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-dask @@ -47,8 +41,6 @@ rapids-conda-retry mambabuild \ rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ - --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-ann-bench @@ -59,8 +51,6 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ - --channel "${RMM_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/raft-ann-bench-cpu fi diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 14741d4f0f..0f8efb171e 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -19,7 +19,6 @@ conda activate test set -u CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) -LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/ mkdir -p "${RAPIDS_TESTS_DIR}" @@ -27,7 +26,6 @@ rapids-print-env rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ libraft-headers libraft libraft-tests rapids-logger "Check GPU usage" diff --git a/ci/test_python.sh b/ci/test_python.sh index 1a40554a78..cb6b7631e4 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -21,8 +21,6 @@ set -u rapids-logger "Downloading artifacts from previous jobs" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python) -LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 cpp) -RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1404 python) RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"} RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"} @@ -33,8 +31,6 @@ rapids-print-env rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ --channel "${PYTHON_CHANNEL}" \ - --channel "${LIBRMM_CHANNEL}" \ - --channel "${RMM_CHANNEL}" \ libraft libraft-headers pylibraft raft-dask rapids-logger "Check GPU usage" diff --git a/cpp/template/cmake/thirdparty/fetch_rapids.cmake b/cpp/template/cmake/thirdparty/fetch_rapids.cmake index ad124375fd..15b6c43a6f 100644 --- a/cpp/template/cmake/thirdparty/fetch_rapids.cmake +++ b/cpp/template/cmake/thirdparty/fetch_rapids.cmake @@ -14,8 +14,6 @@ # Use this variable to update RAPIDS and RAFT versions set(RAPIDS_VERSION "24.02") -set(rapids-cmake-repo bdice/rapids-cmake) -set(rapids-cmake-branch cuco-cccl-2.2.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION}/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index 094304f837..ca871c5759 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -11,8 +11,6 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= -set(rapids-cmake-repo bdice/rapids-cmake) -set(rapids-cmake-branch cuco-cccl-2.2.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake From 456045f3e981120b100069c7cd8690b66ffdbb1a Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 Dec 2023 10:49:24 -0600 Subject: [PATCH 6/7] Update cpp/CMakeLists.txt --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f12c0437d8..dbce46abfe 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -206,7 +206,7 @@ target_include_directories( if(NOT BUILD_CPU_ONLY) # Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target. - target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass CCCL::Thrust) + target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass CCCL::CCCL) endif() target_compile_features(raft INTERFACE cxx_std_17 $) From 871b0b752d7f29be4c9f6ffee237afbfb2920630 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 Dec 2023 09:34:37 -0800 Subject: [PATCH 7/7] Rerun CI with 32 CPUs.