From b417bfdac083293888537cd89ba6070041260eca Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Fri, 25 Aug 2023 08:04:57 -0700 Subject: [PATCH 01/16] Pin container image for clang-tidy CI check to CUDA 11.8. --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b589dc8b84..dd9eea14d7 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -38,7 +38,7 @@ jobs: build_type: pull-request node_type: "cpu8" arch: "amd64" - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci:cuda11.8.0-ubuntu20.04-py3.10" run_script: "ci/run_clang_tidy.sh" conda-cpp-build: needs: checks From 804cfa7eb27fa0c2a1540edef981cc258bc9da08 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Fri, 25 Aug 2023 12:05:07 -0500 Subject: [PATCH 02/16] Update .github/workflows/pr.yaml Co-authored-by: Bradley Dice --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index dd9eea14d7..a84a5ce168 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -38,7 +38,7 @@ jobs: build_type: pull-request node_type: "cpu8" arch: "amd64" - container_image: "rapidsai/ci:cuda11.8.0-ubuntu20.04-py3.10" + container_image: "rapidsai/ci:cuda11.8.0-ubuntu22.04-py3.10" run_script: "ci/run_clang_tidy.sh" conda-cpp-build: needs: checks From e73f07dbd6a0cc9c923d0d083969c99581a1ac2e Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Fri, 25 Aug 2023 13:46:32 -0700 Subject: [PATCH 03/16] Increase the numerical tolerance for test_pairwise_distances tests. --- python/cuml/tests/test_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuml/tests/test_metrics.py b/python/cuml/tests/test_metrics.py index 5e8d8bb7c4..e3a5a3d157 100644 --- a/python/cuml/tests/test_metrics.py +++ b/python/cuml/tests/test_metrics.py @@ -1031,7 +1031,7 @@ def test_pairwise_distances(metric: str, matrix_size, is_col_major): rng = np.random.RandomState(0) # For fp64, compare at 13 decimals, (2 places less than the ~15 max) - compare_precision = 6 + compare_precision = 4 # Compare to sklearn, single input X = prep_dense_array( From 20a147df19dfb89035ba3a3d5342a93237a57828 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Mon, 28 Aug 2023 12:24:47 -0700 Subject: [PATCH 04/16] increase tolerance further --- python/cuml/tests/test_metrics.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/cuml/tests/test_metrics.py b/python/cuml/tests/test_metrics.py index e3a5a3d157..89f22d66a9 100644 --- a/python/cuml/tests/test_metrics.py +++ b/python/cuml/tests/test_metrics.py @@ -1030,8 +1030,7 @@ def test_pairwise_distances(metric: str, matrix_size, is_col_major): # Test the pairwise_distance helper function. rng = np.random.RandomState(0) - # For fp64, compare at 13 decimals, (2 places less than the ~15 max) - compare_precision = 4 + compare_precision = 3 # Compare to sklearn, single input X = prep_dense_array( From 721aed0f2304c00fb5fdd8d4a8429c9495c1e2ae Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Wed, 30 Aug 2023 14:53:07 -0700 Subject: [PATCH 05/16] Decrease compare precision to 2 decimal points. --- python/cuml/tests/test_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuml/tests/test_metrics.py b/python/cuml/tests/test_metrics.py index 89f22d66a9..f826d1e086 100644 --- a/python/cuml/tests/test_metrics.py +++ b/python/cuml/tests/test_metrics.py @@ -1030,7 +1030,7 @@ def test_pairwise_distances(metric: str, matrix_size, is_col_major): # Test the pairwise_distance helper function. rng = np.random.RandomState(0) - compare_precision = 3 + compare_precision = 2 # Compare to sklearn, single input X = prep_dense_array( From f70f1987fd4573f0c19594ea612cee6633b0f61e Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Wed, 30 Aug 2023 15:32:25 -0700 Subject: [PATCH 06/16] Reduce precision only for nan_euclidean metric. --- python/cuml/tests/test_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuml/tests/test_metrics.py b/python/cuml/tests/test_metrics.py index f826d1e086..5a4944c7f0 100644 --- a/python/cuml/tests/test_metrics.py +++ b/python/cuml/tests/test_metrics.py @@ -1030,7 +1030,7 @@ def test_pairwise_distances(metric: str, matrix_size, is_col_major): # Test the pairwise_distance helper function. rng = np.random.RandomState(0) - compare_precision = 2 + compare_precision = 2 if metric == "nan_euclidean" else 6 # Compare to sklearn, single input X = prep_dense_array( From 111252294de31f2180e0f921709c36f41362d2f6 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Thu, 31 Aug 2023 07:58:46 -0700 Subject: [PATCH 07/16] Reduce general precision to 4 decimals. --- python/cuml/tests/test_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuml/tests/test_metrics.py b/python/cuml/tests/test_metrics.py index 5a4944c7f0..d38bf774f5 100644 --- a/python/cuml/tests/test_metrics.py +++ b/python/cuml/tests/test_metrics.py @@ -1030,7 +1030,7 @@ def test_pairwise_distances(metric: str, matrix_size, is_col_major): # Test the pairwise_distance helper function. rng = np.random.RandomState(0) - compare_precision = 2 if metric == "nan_euclidean" else 6 + compare_precision = 2 if metric == "nan_euclidean" else 4 # Compare to sklearn, single input X = prep_dense_array( From c6b5bca7b96783cc8251b8809438dfd8a801416b Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:37:49 -0700 Subject: [PATCH 08/16] pick new RAFT targets --- cpp/CMakeLists.txt | 6 +++--- cpp/cmake/thirdparty/get_raft.cmake | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c5a02cd670..acf35d6669 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -73,7 +73,7 @@ option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg # without installing all its components. This is useful if total file size is # at a premium and we do not expect other consumers to use any APIs of the # dependency except those that are directly linked to by the dependent library. -option(CUML_EXCLUDE_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) +option(CUML_ra_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_TREELITE_FROM_ALL "Exclude Treelite targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_CUMLPRIMS_MG_FROM_ALL "Exclude cumlprims_mg targets from cuML's 'all' target" OFF) option(CUML_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON) @@ -602,7 +602,7 @@ if(BUILD_CUML_CPP_LIBRARY) # These are always private: list(APPEND _cuml_cpp_private_libs - raft::raft + ${RAFT_LIB} $ $<$:CUDA::cufft${_ctk_static_suffix}> ${TREELITE_LIBS} @@ -622,7 +622,7 @@ if(BUILD_CUML_CPP_LIBRARY) # because cumlprims_mg and cuML inherit their CUDA libs from the raft::raft # INTERFACE target. list(APPEND ${_cuml_cpp_libs_var_name} - $<$:raft::compiled> + $<$:${RAFT_COMPILED_LIB}> $ ) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index b335b075b2..813ed470cb 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -36,19 +36,26 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " distributed") endif() + if(NOT PKG_USE_RAFT_STATIC) + set(RAFT_LIB raft::raft) + else() + set(RAFT_LIB raft::raft_static) + endif() + if(PKG_COMPILE_LIBRARY) - string(APPEND RAFT_COMPONENTS " compiled") + if(NOT PKG_USE_RAFT_STATIC) + string(APPEND RAFT_COMPONENTS " compiled") + set(RAFT_COMPILED_LIB raft::compiled) + else() + string(APPEND RAFT_COMPONENTS " compiled_static") + set(RAFT_COMPILED_LIB raft::compiled_static) + endif() set(RAFT_COMPILE_LIBRARY ON) else() set(RAFT_COMPILE_LIBRARY OFF) endif() - set(RAFT_BUILD_SHARED_LIBS ON) - if(${PKG_USE_RAFT_STATIC}) - set(RAFT_BUILD_SHARED_LIBS OFF) - endif() - # We need to set this each time so that on subsequent calls to cmake # the raft-config.cmake re-evaluates the RAFT_NVTX value set(RAFT_NVTX ${PKG_NVTX}) @@ -68,7 +75,6 @@ function(find_and_configure_raft) OPTIONS "BUILD_TESTS OFF" "BUILD_BENCH OFF" - "BUILD_SHARED_LIBS ${RAFT_BUILD_SHARED_LIBS}" "RAFT_COMPILE_LIBRARY ${PKG_COMPILE_LIBRARY}" ) From 6efac97d94969bb7fb7af440bc946eea8b9c1d75 Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:40:26 -0700 Subject: [PATCH 09/16] fix typo --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index acf35d6669..472c856eab 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -73,7 +73,7 @@ option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg # without installing all its components. This is useful if total file size is # at a premium and we do not expect other consumers to use any APIs of the # dependency except those that are directly linked to by the dependent library. -option(CUML_ra_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) +option(CUML_EXCLUDE_RAFT_FROM_ALL "Exclude RAFT targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_TREELITE_FROM_ALL "Exclude Treelite targets from cuML's 'all' target" OFF) option(CUML_EXCLUDE_CUMLPRIMS_MG_FROM_ALL "Exclude cumlprims_mg targets from cuML's 'all' target" OFF) option(CUML_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON) From 2b52f32c4bb1eb8e93eb30c0d9db92da228b422a Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:43:16 -0700 Subject: [PATCH 10/16] fix target name --- cpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 472c856eab..1716dbb3cb 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -577,8 +577,8 @@ if(BUILD_CUML_CPP_LIBRARY) set(_cuml_cpp_public_libs) set(_cuml_cpp_private_libs) - if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft)) - copy_interface_excludes(INCLUDED_TARGET raft::raft TARGET ${CUML_CPP_TARGET}) + if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft_static)) + copy_interface_excludes(INCLUDED_TARGET raft::raft_static TARGET ${CUML_CPP_TARGET}) if(CUML_USE_RAFT_DIST AND (TARGET cuco::cuco)) list(APPEND _cuml_cpp_private_libs cuco::cuco) From 2d2a64939134233b2012ebf28c3a2df758245e8f Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 12:48:27 -0700 Subject: [PATCH 11/16] no such thing as raft::raft_static --- cpp/CMakeLists.txt | 6 +++--- cpp/cmake/thirdparty/get_raft.cmake | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 1716dbb3cb..0ad691fdbf 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -577,8 +577,8 @@ if(BUILD_CUML_CPP_LIBRARY) set(_cuml_cpp_public_libs) set(_cuml_cpp_private_libs) - if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft_static)) - copy_interface_excludes(INCLUDED_TARGET raft::raft_static TARGET ${CUML_CPP_TARGET}) + if(CUML_USE_RAFT_STATIC AND (TARGET raft::raft)) + copy_interface_excludes(INCLUDED_TARGET raft::raft TARGET ${CUML_CPP_TARGET}) if(CUML_USE_RAFT_DIST AND (TARGET cuco::cuco)) list(APPEND _cuml_cpp_private_libs cuco::cuco) @@ -602,7 +602,7 @@ if(BUILD_CUML_CPP_LIBRARY) # These are always private: list(APPEND _cuml_cpp_private_libs - ${RAFT_LIB} + raft::raft $ $<$:CUDA::cufft${_ctk_static_suffix}> ${TREELITE_LIBS} diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 813ed470cb..d30d3c4392 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -36,13 +36,6 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " distributed") endif() - if(NOT PKG_USE_RAFT_STATIC) - set(RAFT_LIB raft::raft) - else() - set(RAFT_LIB raft::raft_static) - endif() - - if(PKG_COMPILE_LIBRARY) if(NOT PKG_USE_RAFT_STATIC) string(APPEND RAFT_COMPONENTS " compiled") From 22476cd795ca85d5ee79aa3ee083e88171b2a52e Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 1 Sep 2023 17:17:14 -0700 Subject: [PATCH 12/16] bump From ce368d1fa20fe4ac75711d9f2a47d30363871251 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 5 Sep 2023 15:18:33 -0400 Subject: [PATCH 13/16] Propagate RAFT_COMPILED_LIB to correct scope --- cpp/cmake/thirdparty/get_raft.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index d30d3c4392..78262a167c 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -39,10 +39,10 @@ function(find_and_configure_raft) if(PKG_COMPILE_LIBRARY) if(NOT PKG_USE_RAFT_STATIC) string(APPEND RAFT_COMPONENTS " compiled") - set(RAFT_COMPILED_LIB raft::compiled) + set(RAFT_COMPILED_LIB raft::compiled PARENT_SCOPE) else() string(APPEND RAFT_COMPONENTS " compiled_static") - set(RAFT_COMPILED_LIB raft::compiled_static) + set(RAFT_COMPILED_LIB raft::compiled_static PARENT_SCOPE) endif() set(RAFT_COMPILE_LIBRARY ON) else() From 9658aa56d85e4f8baf415403d6cbd4afe7bbd0ca Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 5 Sep 2023 14:41:34 -0700 Subject: [PATCH 14/16] remove unnecessary variable setting --- cpp/cmake/thirdparty/get_raft.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake index 78262a167c..8919feb45d 100644 --- a/cpp/cmake/thirdparty/get_raft.cmake +++ b/cpp/cmake/thirdparty/get_raft.cmake @@ -44,9 +44,6 @@ function(find_and_configure_raft) string(APPEND RAFT_COMPONENTS " compiled_static") set(RAFT_COMPILED_LIB raft::compiled_static PARENT_SCOPE) endif() - set(RAFT_COMPILE_LIBRARY ON) - else() - set(RAFT_COMPILE_LIBRARY OFF) endif() # We need to set this each time so that on subsequent calls to cmake From b46e087942cd520b9dfed7c8a46b0bd25e0c4537 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Sep 2023 11:49:55 -0500 Subject: [PATCH 15/16] Use conda mambabuild not mamba mambabuild. --- ci/build_cpp.sh | 2 +- ci/build_python.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 0feb1bf80b..bc6b2f23b4 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -11,6 +11,6 @@ rapids-print-env rapids-logger "Begin cpp build" -rapids-mamba-retry mambabuild conda/recipes/libcuml +rapids-conda-retry mambabuild conda/recipes/libcuml rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 2eca4a33ef..79b8813c4a 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -15,7 +15,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -rapids-mamba-retry mambabuild \ +rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuml From ed1040dd27d190e5bbc9079197a7f3c0cea5ed57 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Tue, 12 Sep 2023 11:38:41 -0700 Subject: [PATCH 16/16] Fix _extract_partitions function. --- python/cuml/dask/common/part_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuml/dask/common/part_utils.py b/python/cuml/dask/common/part_utils.py index 39466bf075..a6aa892a76 100644 --- a/python/cuml/dask/common/part_utils.py +++ b/python/cuml/dask/common/part_utils.py @@ -160,7 +160,7 @@ def _extract_partitions(dask_obj, client=None): yield wait(parts) - key_to_part = [(str(part.key), part) for part in parts] + key_to_part = [(part.key, part) for part in parts] who_has = yield client.who_has(parts) raise gen.Return(