Skip to content

Commit 7dbd36e

Browse files
authored
Remove cutlass and cuco dependencies (rapidsai#2916)
As the `distance` APIs are now moved to cuVS, we can remove the cutlass and cuco dependencies and avoid shipping the headers. Closes rapidsai#2914 Reduces CUDA 13 libraft wheel size from 18.9M to 14.5M. Authors: - Divye Gala (https://github.com/divyegala) - Bradley Dice (https://github.com/bdice) Approvers: - Bradley Dice (https://github.com/bdice) - Dante Gama Dessavre (https://github.com/dantegd) - Corey J. Nolet (https://github.com/cjnolet) URL: rapidsai#2916
1 parent 2ca8b09 commit 7dbd36e

10 files changed

Lines changed: 16 additions & 196 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33

44
repos:
@@ -83,7 +83,6 @@ repos:
8383
exclude: |
8484
(?x)
8585
^CHANGELOG[.]md$|
86-
^cpp/cmake/patches/cutlass/build-export[.]patch$
8786
- repo: https://github.com/pre-commit/pre-commit-hooks
8887
rev: v5.0.0
8988
hooks:

conda/recipes/libraft/recipe.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33
schema_version: 1
44

@@ -90,9 +90,8 @@ outputs:
9090
build:
9191
script:
9292
content: |
93-
# Unspecified brings in cuco and cutlass and friends
93+
# Unspecified brings in all components
9494
cmake --install cpp/build --component Unspecified
95-
cmake --install cpp/build --component cuco
9695
cmake --install cpp/build --component raft
9796
cmake --install cpp/build --component distributed
9897
string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }}

cpp/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ IncludeCategories:
8585
Priority: 5
8686
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
8787
Priority: 6
88-
- Regex: '^<(cooperative_groups|cuco|cuda|device_types|driver_types|math_constants|nvtx3)' # CUDA includes
88+
- Regex: '^<(cooperative_groups|cuda|device_types|driver_types|math_constants|nvtx3)' # CUDA includes
8989
Priority: 6
9090
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
9191
Priority: 7

cpp/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# =============================================================================
22
# cmake-format: off
3-
# SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION.
3+
# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
44
# SPDX-License-Identifier: Apache-2.0
55
# cmake-format: on
66
cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
@@ -164,13 +164,9 @@ include(${rapids-cmake-dir}/cpm/rapids_logger.cmake)
164164
rapids_cpm_rapids_logger(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports)
165165
create_logger_macros(RAFT "raft::default_logger()" include/raft/core)
166166

167-
# CCCL before rmm/cuco so we get the right version of CCCL
167+
# CCCL before rmm so we get the right version of CCCL
168168
include(cmake/thirdparty/get_cccl.cmake)
169169
include(cmake/thirdparty/get_rmm.cmake)
170-
include(cmake/thirdparty/get_cutlass.cmake)
171-
172-
include(${rapids-cmake-dir}/cpm/cuco.cmake)
173-
rapids_cpm_cuco(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports)
174170

175171
if(BUILD_TESTS)
176172
include(${rapids-cmake-dir}/cpm/gtest.cmake)
@@ -193,10 +189,7 @@ target_include_directories(
193189
)
194190

195191
# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target.
196-
target_link_libraries(
197-
raft INTERFACE rapids_logger::rapids_logger rmm::rmm cuco::cuco nvidia::cutlass::cutlass
198-
CCCL::CCCL
199-
)
192+
target_link_libraries(raft INTERFACE rapids_logger::rapids_logger rmm::rmm CCCL::CCCL)
200193

201194
target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
202195
target_compile_options(

cpp/cmake/patches/cutlass/Support-both-CUDA-12-and-13-cccl-header-locations.patch

Lines changed: 0 additions & 31 deletions
This file was deleted.

cpp/cmake/patches/cutlass_override.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

cpp/cmake/thirdparty/get_cutlass.cmake

Lines changed: 0 additions & 78 deletions
This file was deleted.

cpp/include/raft/util/cutlass_utils.cuh

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/source/build.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ In addition to the libraries included with cudatoolkit 12.2+, there are some oth
8686
#### Required
8787
- [RMM](https://github.com/rapidsai/rmm) corresponding to RAFT version.
8888
- [Thrust](https://github.com/NVIDIA/thrust) v1.17 / [CUB](https://github.com/NVIDIA/cub)
89-
- [cuCollections](https://github.com/NVIDIA/cuCollections) - Used in `raft::sparse::distance` API.
90-
- [CUTLASS](https://github.com/NVIDIA/cutlass) v2.9.1 - Used in `raft::distance` API.
9189

9290
#### Optional
9391
- [NCCL](https://github.com/NVIDIA/nccl) - Used in `raft::comms` API and needed to build `raft-dask`.
@@ -110,7 +108,7 @@ The recommended way to build and install RAFT from source is to use the `build.s
110108

111109
### Header-only C++
112110

113-
`build.sh` uses [rapids-cmake](https://github.com/rapidsai/rapids-cmake), which will automatically download any dependencies which are not already installed. It's important to note that while all the headers will be installed and available, some parts of the RAFT API depend on libraries like CUTLASS, which will need to be explicitly enabled in `build.sh`.
111+
`build.sh` uses [rapids-cmake](https://github.com/rapidsai/rapids-cmake), which will automatically download any dependencies which are not already installed.
114112

115113
The following example will download the needed dependencies and install the RAFT headers into `$INSTALL_PREFIX/include/raft`.
116114
```bash
@@ -288,8 +286,8 @@ PROPERTIES CXX_STANDARD 20
288286

289287
The `raft::raft` CMake target is made available when including RAFT into your CMake project but additional CMake targets can be made available by adding to the `COMPONENTS` option in CMake's `find_package(raft)` (refer to [CMake docs](https://cmake.org/cmake/help/latest/command/find_package.html#basic-signature) to learn more). The components should be separated by spaces. The `raft::raft` target will always be available. Note that the `distributed` component also exports additional dependencies.
290288

291-
| Component | Target | Description | Base Dependencies |
292-
|-------------|---------------------|----------------------------------------------------------|----------------------------------------|
293-
| n/a | `raft::raft` | Full RAFT header library | CUDA toolkit, RMM, NVTX, CCCL, CUTLASS |
294-
| compiled | `raft::compiled` | Pre-compiled template instantiations and runtime library | raft::raft |
295-
| distributed | `raft::distributed` | Dependencies for `raft::comms` APIs | raft::raft, UCX, NCCL
289+
| Component | Target | Description | Base Dependencies |
290+
|-------------|---------------------|----------------------------------------------------------|-------------------------------|
291+
| n/a | `raft::raft` | Full RAFT header library | CUDA toolkit, RMM, NVTX, CCCL |
292+
| compiled | `raft::compiled` | Pre-compiled template instantiations and runtime library | raft::raft |
293+
| distributed | `raft::distributed` | Dependencies for `raft::comms` APIs | raft::raft, UCX, NCCL |

python/pylibraft/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# =============================================================================
22
# cmake-format: off
3-
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
3+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
44
# SPDX-License-Identifier: Apache-2.0
55
# cmake-format: on
66
# =============================================================================
@@ -9,8 +9,7 @@ cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
99

1010
include(../../cmake/rapids_config.cmake)
1111

12-
# We always need CUDA for pylibraft because the raft dependency brings in a header-only cuco
13-
# dependency that enables CUDA unconditionally.
12+
# We always need CUDA for pylibraft because the raft dependency enables CUDA unconditionally.
1413
include(rapids-cuda)
1514
rapids_cuda_init_architectures(pylibraft)
1615

@@ -20,7 +19,7 @@ project(
2019
LANGUAGES CXX CUDA
2120
)
2221

23-
# an installed version of raft contains the other necessary targets (like CCCL and cuco)
22+
# an installed version of raft contains the other necessary targets (like CCCL)
2423
find_package(raft "${RAPIDS_VERSION}" REQUIRED COMPONENTS raft compiled)
2524

2625
include(rapids-cython-core)

0 commit comments

Comments
 (0)