Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/branch-25.02' into wip_rf_interop
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Jan 22, 2025
2 parents cc9e1e2 + 01e19bb commit 4b2bcb4
Show file tree
Hide file tree
Showing 35 changed files with 501 additions and 108 deletions.
8 changes: 3 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ cpp/ @rapidsai/cuml-cpp-codeowners
python/ @rapidsai/cuml-python-codeowners

#cmake code owners
**/CMakeLists.txt @rapidsai/cuml-cmake-codeowners
**/cmake/ @rapidsai/cuml-cmake-codeowners
python/cuml/pyproject.toml @rapidsai/cuml-cmake-codeowners
build.sh @rapidsai/cuml-cmake-codeowners
**/build.sh @rapidsai/cuml-cmake-codeowners
CMakeLists.txt @rapidsai/cuml-cmake-codeowners
*.cmake @rapidsai/cuml-cmake-codeowners
**/cmake/ @rapidsai/cuml-cmake-codeowners

#CI code owners
/.github/ @rapidsai/ci-codeowners
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ jobs:
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuml
package-type: python
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ cpp/Doxyfile
# clang tooling
compile_commands.json
.clangd/

# generally prefer 'pyproject.toml' to 'pytest.ini' for pytest options
# ref: https://github.com/rapidsai/cuml/pull/6201
pytest.ini
!python/cuml/cuml/benchmark/automated/pytest.ini
7 changes: 4 additions & 3 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -euo pipefail

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist
RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/cuml*.whl)[test]
python -m pip install \
"$(echo ./dist/cuml*.whl)[test]"

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
mkdir -p "${RAPIDS_TESTS_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies:
- sphinx-copybutton
- sphinx-markdown-tables
- statsmodels
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- treelite==4.4.1
- umap-learn==0.5.6
- xgboost>=2.1.0
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- dask-ml
- doxygen=1.9.1
- fmt>=11.0.2,<12
- gcc_linux-64=11.*
- gcc_linux-64=13.*
- graphviz
- hdbscan>=0.8.39,<0.8.40
- hypothesis>=6.0,<7
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies:
- sphinx-copybutton
- sphinx-markdown-tables
- statsmodels
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- treelite==4.4.1
- umap-learn==0.5.6
- xgboost>=2.1.0
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/clang_tidy_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ dependencies:
- ninja
- nvcc_linux-64=11.8
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- tomli
name: clang_tidy_cuda-118_arch-x86_64
2 changes: 1 addition & 1 deletion conda/environments/cpp_all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ dependencies:
- ninja
- nvcc_linux-64=11.8
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
name: cpp_all_cuda-118_arch-x86_64
4 changes: 2 additions & 2 deletions conda/environments/cpp_all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- cuda-version=12.5
- cxx-compiler
- fmt>=11.0.2,<12
- gcc_linux-64=11.*
- gcc_linux-64=13.*
- libcublas-dev
- libcufft-dev
- libcumlprims==25.2.*,>=0.0.0a0
Expand All @@ -27,5 +27,5 @@ dependencies:
- librmm==25.2.*,>=0.0.0a0
- ninja
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
name: cpp_all_cuda-125_arch-x86_64
8 changes: 5 additions & 3 deletions conda/recipes/cuml-cpu/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand All @@ -11,4 +13,4 @@ c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"
14 changes: 7 additions & 7 deletions conda/recipes/cuml/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc
- cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand All @@ -17,7 +17,7 @@ c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"

treelite_version:
- "=4.3.0"
8 changes: 3 additions & 5 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand Down Expand Up @@ -33,10 +33,8 @@ build:
- SCCACHE_S3_KEY_PREFIX=cuml-linux64 # [linux64]
- SCCACHE_S3_USE_SSL
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
- cuda-python
Expand All @@ -46,7 +44,7 @@ requirements:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
- {{ compiler('cuda') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
Expand Down
14 changes: 7 additions & 7 deletions conda/recipes/libcuml/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc
- cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand Down
16 changes: 5 additions & 11 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand All @@ -14,9 +14,7 @@ source:

build:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% endif %}
- {{ compiler('cuda') }}
script_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Expand All @@ -38,7 +36,7 @@ requirements:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
- {{ compiler('cuda') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
Expand Down Expand Up @@ -84,10 +82,8 @@ outputs:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
requirements:
Expand Down Expand Up @@ -131,10 +127,8 @@ outputs:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
requirements:
Expand Down
23 changes: 23 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ option(USE_CCACHE "Cache build artifacts with ccache" OFF)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)
option(CUDA_STATIC_MATH_LIBRARIES "Statically link the CUDA math libraries" OFF)
option(CUML_USE_CUVS_STATIC "Build and statically link the CUVS library" OFF)
option(CUML_USE_RAFT_STATIC "Build and statically link the RAFT library" OFF)
option(CUML_USE_TREELITE_STATIC "Build and statically link the treelite library" OFF)
option(CUML_EXPORT_TREELITE_LINKAGE "Whether to publicly or privately link treelite to libcuml++" OFF)
option(CUML_USE_CUMLPRIMS_MG_STATIC "Build and statically link the cumlprims_mg library" OFF)
Expand Down Expand Up @@ -99,6 +100,7 @@ message(VERBOSE "CUML_CPP: Cache build artifacts with ccache: ${USE_CCACHE}")
message(VERBOSE "CUML_CPP: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
message(VERBOSE "CUML_CPP: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}")
message(VERBOSE "CUML_CPP: Build and statically link CUVS libraries: ${CUML_USE_CUVS_STATIC}")
message(VERBOSE "CUML_CPP: Build and statically link RAFT library: ${CUML_USE_RAFT_STATIC}")
message(VERBOSE "CUML_CPP: Build and statically link Treelite library: ${CUML_USE_TREELITE_STATIC}")

set(CUML_ALGORITHMS "ALL" CACHE STRING "Experimental: Choose which algorithms are built into libcuml++.so. Can specify individual algorithms or groups in a semicolon-separated list.")
Expand Down Expand Up @@ -420,6 +422,27 @@ if(BUILD_CUML_CPP_LIBRARY)
src/hdbscan/hdbscan.cu
src/hdbscan/condensed_hierarchy.cu
src/hdbscan/prediction_data.cu)

# When using GCC 13, some maybe-uninitialized warnings appear from CCCL and are treated as errors.
# See this issue: https://github.com/rapidsai/cuml/issues/6225
set_property(
SOURCE src/hdbscan/condensed_hierarchy.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
set_property(
SOURCE src/hdbscan/hdbscan.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
set_property(
SOURCE src/hdbscan/prediction_data.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
endif()

if(all_algo OR holtwinters_algo)
Expand Down
3 changes: 2 additions & 1 deletion cpp/cmake/thirdparty/get_cuvs.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,6 +55,7 @@ function(find_and_configure_cuvs)
OPTIONS
"BUILD_TESTS OFF"
"BUILD_BENCH OFF"
"BUILD_CAGRA_HNSWLIB OFF"
"BUILD_MG_ALGOS ${CUVS_BUILD_MG_ALGOS}"

)
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,7 +43,7 @@ function(find_and_configure_raft)
message(VERBOSE "CUML: raft FIND_PACKAGE_ARGUMENTS COMPONENTS ${RAFT_COMPONENTS}")

rapids_cpm_find(raft ${PKG_VERSION}
GLOBAL_TARGETS raft::raft
GLOBAL_TARGETS raft::raft raft::raft_logger raft::raft_logger_impl
BUILD_EXPORT_SET cuml-exports
INSTALL_EXPORT_SET cuml-exports
COMPONENTS ${RAFT_COMPONENTS}
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/hdbscan/condensed_hierarchy.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@

#include <cub/cub.cuh>
#include <cuda/functional>
#include <cuda/std/functional>
#include <thrust/copy.h>
#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
Expand Down Expand Up @@ -157,8 +158,9 @@ void CondensedHierarchy<value_idx, value_t>::condense(value_idx* full_parents,
thrust::cuda::par.on(stream),
full_sizes,
full_sizes + size,
cuda::proclaim_return_type<bool>([=] __device__(value_idx a) -> bool { return a != -1; }),
0,
cuda::proclaim_return_type<value_idx>(
[=] __device__(value_idx a) -> value_idx { return static_cast<value_idx>(a != -1); }),
static_cast<value_idx>(0),
thrust::plus<value_idx>());

parents.resize(n_edges, stream);
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/hdbscan/detail/utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
#include <rmm/exec_policy.hpp>

#include <cub/cub.cuh>
#include <cuda/functional>
#include <thrust/copy.h>
#include <thrust/execution_policy.h>
#include <thrust/for_each.h>
Expand Down Expand Up @@ -114,8 +115,9 @@ Common::CondensedHierarchy<value_idx, value_t> make_cluster_tree(
thrust_policy,
sizes,
sizes + condensed_tree.get_n_edges(),
cuda::proclaim_return_type<bool>([=] __device__(value_idx a) -> bool { return a > 1; }),
0,
cuda::proclaim_return_type<value_idx>(
[=] __device__(value_idx a) -> value_idx { return static_cast<value_idx>(a > 1); }),
static_cast<value_idx>(0),
thrust::plus<value_idx>());

// remove leaves from condensed tree
Expand Down
Loading

0 comments on commit 4b2bcb4

Please sign in to comment.