Skip to content

Commit 77d597b

Browse files
authored
Update to RAFT v26.02 (#750)
1 parent 7a80fb7 commit 77d597b

4 files changed

Lines changed: 28 additions & 39 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ find_package(Cython REQUIRED)
99
find_package(OpenMP)
1010

1111
include_directories(.)
12-
set (CMAKE_CXX_STANDARD 11)
12+
set (CMAKE_CXX_STANDARD 17)
1313
add_subdirectory(implicit)

implicit/gpu/CMakeLists.txt

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,43 @@ else()
1313
enable_language(CUDA)
1414
add_cython_target(_cuda CXX)
1515

16+
add_compile_options(-DCCCL_IGNORE_DEPRECATED_STREAM_REF_HEADER)
17+
1618
# use rapids-cmake to install dependencies
17-
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake
19+
set(rapids-cmake-version "26.02")
20+
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/refs/heads/release/26.02/RAPIDS.cmake
1821
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
1922
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
2023
include(rapids-cmake)
2124
include(rapids-cpm)
2225
include(rapids-cuda)
2326
include(rapids-export)
2427
include(rapids-find)
25-
include(${rapids-cmake-dir}/cpm/package_override.cmake)
2628

2729
rapids_cpm_init()
2830
rapids_cmake_build_type(Release)
2931

30-
# thrust/cub have a cmake issue where the conda build fails
31-
# to find them, and needs these patches
32-
# https://github.com/benfred/cub/commit/97934d146b771fd2e8bda75f73349a4b3c9e10a7
33-
# https://github.com/benfred/thrust/commit/8452c764cc8d772314169e99811535f3a9108cfe
34-
# (note that cub is pulled in through thrust here - meaning we only need to override
35-
# the thrust version to pull it in)
36-
# Issue is tracked in https://github.com/NVIDIA/thrust/issues/1966
37-
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
38-
[=[
39-
{
40-
"packages" : {
41-
"Thrust" : {
42-
"version" : "1.17.2",
43-
"git_url" : "https://github.com/benfred/thrust.git",
44-
"git_tag" : "no_cmake_find_root_path",
45-
"git_shallow" : true,
46-
"always_download" : true,
47-
}
48-
}
49-
}
50-
]=])
51-
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)
32+
# We must find CCCL ourselves before raft so that we get the right version.
33+
include(${rapids-cmake-dir}/cpm/cccl.cmake)
34+
rapids_cpm_cccl(BUILD_EXPORT_SET implicit-exports INSTALL_EXPORT_SET implicit-exports)
5235

5336
# get rmm
5437
include(${rapids-cmake-dir}/cpm/rmm.cmake)
5538
rapids_cpm_rmm(BUILD_EXPORT_SET implicit-exports INSTALL_EXPORT_SET implicit-exports)
5639

57-
# get raft
58-
# note: we're using RAFT in header only mode right now - mainly to reduce binary
59-
# size of the compiled wheels
60-
rapids_cpm_find(raft 23.12
40+
rapids_cpm_find(raft 26.02
41+
GLOBAL_TARGETS raft::raft
42+
BUILD_EXPORT_SET implicit-exports
43+
INSTALL_EXPORT_SET implicit-exports
6144
CPM_ARGS
6245
GIT_REPOSITORY https://github.com/rapidsai/raft.git
63-
GIT_TAG branch-23.12
64-
DOWNLOAD_ONLY YES
46+
GIT_TAG v26.02.00
47+
SOURCE_SUBDIR cpp
48+
OPTIONS
49+
"BUILD_TESTS OFF"
50+
"BUILD_PRIMS_BENCH OFF"
51+
"RAFT_COMPILE_LIBRARY OFF"
6552
)
66-
include_directories(${raft_SOURCE_DIR}/cpp/include)
67-
6853
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda -Wno-deprecated-gpu-targets -Xfatbin=-compress-all --expt-relaxed-constexpr")
6954

7055
add_library(_cuda MODULE ${_cuda}
@@ -85,15 +70,15 @@ else()
8570
set_target_properties(_cuda PROPERTIES CUDA_ARCHITECTURES "60;70;80")
8671
elseif (${CUDAToolkit_VERSION} VERSION_LESS "11.8.0")
8772
set_target_properties(_cuda PROPERTIES CUDA_ARCHITECTURES "60;70;80;86")
88-
elseif (${CUDAToolkit_VERSION} VERSION_LESS "12.0.0")
73+
elseif (${CUDAToolkit_VERSION} VERSION_LESS "13.0.0")
8974
set_target_properties(_cuda PROPERTIES CUDA_ARCHITECTURES "60;70;80;86;90")
9075
else()
9176
set_target_properties(_cuda PROPERTIES CUDA_ARCHITECTURES "80;86;90;100;120")
9277
endif()
9378
get_target_property(CUDA_ARCH _cuda CUDA_ARCHITECTURES)
9479
message("using cuda architectures ${CUDA_ARCH} for cuda version ${CUDAToolkit_VERSION}")
9580
endif()
96-
target_link_libraries(_cuda CUDA::cublas CUDA::curand rmm::rmm)
81+
target_link_libraries(_cuda CUDA::cublas CUDA::curand rmm::rmm raft::raft)
9782

9883
install(TARGETS _cuda LIBRARY DESTINATION implicit/gpu)
9984
endif()

implicit/gpu/knn.cu

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
#include <cfloat>
12
#include <vector>
23

34
#include <cub/device/device_radix_sort.cuh>
45
#include <cub/device/device_segmented_radix_sort.cuh>
56
#include <cuda_runtime.h>
67
#include <rmm/cuda_stream_view.hpp>
7-
#include <rmm/mr/device/cuda_memory_resource.hpp>
8-
#include <rmm/mr/device/device_memory_resource.hpp>
9-
#include <rmm/mr/device/pool_memory_resource.hpp>
8+
#include <rmm/mr/cuda_memory_resource.hpp>
9+
#include <rmm/mr/device_memory_resource.hpp>
10+
#include <rmm/mr/pool_memory_resource.hpp>
1011
#include <thrust/device_ptr.h>
1112
#include <thrust/functional.h>
1213
#include <thrust/iterator/constant_iterator.h>

implicit/gpu/knn.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
#include <memory>
44

55
#include <raft/core/resources.hpp>
6-
#include <rmm/mr/device/device_memory_resource.hpp>
76

87
#include "implicit/gpu/matrix.h"
98

9+
namespace rmm::mr {
10+
struct device_memory_resource;
11+
}
12+
1013
namespace implicit {
1114
namespace gpu {
1215
class KnnQuery {

0 commit comments

Comments
 (0)