You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-65Lines changed: 33 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# <divalign="left"><imgsrc="https://rapids.ai/assets/images/rapids_logo.png"width="90px"/> RAFT: Reusable Accelerated Functions and Tools</div>
2
2
3
+

4
+
3
5
## Resources
4
6
5
7
-[RAFT Reference Documentation](https://docs.rapids.ai/api/raft/stable/): API Documentation.
@@ -32,12 +34,16 @@ While not exhaustive, the following general categories help summarize the accele
32
34
|**Tools & Utilities**| common utilities for developing CUDA applications, multi-node multi-gpu infrastructure |
33
35
34
36
35
-
All of RAFT's C++ APIs can be accessed header-only and optional pre-compiled shared libraries can 1) speed up compile times and 2) enable the APIs to be used without CUDA-enabled compilers.
37
+
RAFT is a C++ header-only template library with an optional shared library that
38
+
1) can speed up compile times for common template types, and
39
+
2) provides host-accessible "runtime" APIs, which don't require a CUDA compiler to use
36
40
37
-
In addition to the C++ library, RAFT also provides 2 Python libraries:
In addition being a C++ library, RAFT also provides 2 Python libraries:
42
+
-`pylibraft` - lightweight Python wrappers around RAFT's host-accessible "runtime" APIs.
39
43
-`raft-dask` - multi-node multi-GPU communicator infrastructure for building distributed algorithms on the GPU with Dask.
40
44
45
+

46
+
41
47
## Getting started
42
48
43
49
### RAPIDS Memory Manager (RMM)
@@ -46,7 +52,7 @@ RAFT relies heavily on RMM which eases the burden of configuring different alloc
46
52
47
53
### Multi-dimensional Arrays
48
54
49
-
The APIs in RAFT currently accept raw pointers to device memory and we are in the process of simplifying the APIs with the [mdspan](https://arxiv.org/abs/2010.06474) multi-dimensional array view for representing data in higher dimensions similar to the `ndarray` in the Numpy Python library. RAFT also contains the corresponding owning `mdarray` structure, which simplifies the allocation and management of multi-dimensional data in both host and device (GPU) memory.
55
+
The APIs in RAFT accept the [mdspan](https://arxiv.org/abs/2010.06474) multi-dimensional array view for representing data in higher dimensions similar to the `ndarray` in the Numpy Python library. RAFT also contains the corresponding owning `mdarray` structure, which simplifies the allocation and management of multi-dimensional data in both host and device (GPU) memory.
50
56
51
57
The `mdarray` forms a convenience layer over RMM and can be constructed in RAFT using a number of different helper functions:
52
58
@@ -78,9 +84,9 @@ raft::device_resources handle;
78
84
int n_samples = 5000;
79
85
int n_features = 50;
80
86
81
-
auto input = raft::make_device_matrix<float>(handle, n_samples, n_features);
82
-
auto labels = raft::make_device_vector<int>(handle, n_samples);
83
-
auto output = raft::make_device_matrix<float>(handle, n_samples, n_samples);
87
+
auto input = raft::make_device_matrix<float, int>(handle, n_samples, n_features);
88
+
auto labels = raft::make_device_vector<int, int>(handle, n_samples);
89
+
auto output = raft::make_device_matrix<float, int>(handle, n_samples, n_samples);
You can also install the `libraft-*`conda packages individually using the `mamba` command above.
210
+
You can also install the conda packages individually using the `mamba` command above.
206
211
207
-
After installing RAFT, `find_package(raft COMPONENTS nn distance)` can be used in your CUDA/C++ cmake build to compile and/or link against needed dependencies in your raft target. `COMPONENTS` are optional and will depend on the packages installed.
212
+
After installing RAFT, `find_package(raft COMPONENTS compiled distributed)` can be used in your CUDA/C++ cmake build to compile and/or link against needed dependencies in your raft target. `COMPONENTS` are optional and will depend on the packages installed.
208
213
209
214
### Pip
210
215
211
216
pylibraft and raft-dask both have experimental packages that can be [installed through pip](https://rapids.ai/pip.html#install):
RAFT uses the [RAPIDS-CMake](https://github.com/rapidsai/rapids-cmake) library, which makes it simple to include in downstream cmake projects. RAPIDS CMake provides a convenience layer around CPM.
220
-
221
-
After [installing](https://github.com/rapidsai/rapids-cmake#installation) rapids-cmake in your project, you can begin using RAFT by placing the code snippet below in a file named `get_raft.cmake` and including it in your cmake build with `include(get_raft.cmake)`. This will make available several targets to add to configure the link libraries for your artifacts.
222
-
223
-
```cmake
224
-
225
-
set(RAFT_VERSION "22.12")
226
-
set(RAFT_FORK "rapidsai")
227
-
set(RAFT_PINNED_TAG "branch-${RAFT_VERSION}")
228
-
229
-
function(find_and_configure_raft)
230
-
set(oneValueArgs VERSION FORK PINNED_TAG COMPILE_LIBRARIES)
RAFT uses the [RAPIDS-CMake](https://github.com/rapidsai/rapids-cmake) library, which makes it easy to include in downstream cmake projects. RAPIDS-CMake provides a convenience layer around CPM. Please refer to [these instructions](https://github.com/rapidsai/rapids-cmake#installation) to install and use rapids-cmake in your project.
225
+
226
+
#### Example Template Project
227
+
228
+
You can find an [example RAFT](cpp/template/README.md) project template in the `cpp/template` directory, which demonstrates how to build a new application with RAFT or incorporate RAFT into an existing cmake project.
229
+
230
+
#### CMake Targets
263
231
264
-
Several CMake targets can be made available by adding components in the table below to the `RAFT_COMPONENTS` list above, separated by spaces. The `raft::raft` target will always be available. RAFT headers require, at a minimum, the CUDA toolkit libraries and RMM dependencies.
232
+
Additional CMake targets can be made available by adding components in the table below to the `RAFT_COMPONENTS` list above, separated by spaces. The `raft::raft` target will always be available. RAFT headers require, at a minimum, the CUDA toolkit libraries and RMM dependencies.
265
233
266
-
| Component | Target | Description | Base Dependencies |
267
-
| --- | --- | --- | --- |
268
-
| n/a |`raft::raft`| Full RAFT header library | CUDA toolkit library, RMM, Thrust (optional), NVTools (optional) |
The [build](docs/source/build.md) instructions contain more details on building RAFT from source and including it in downstream projects. You can also find a more comprehensive version of the above CPM code snippet the [Building RAFT C++ from source](docs/source/build.md#building-raft-c-from-source-in-cmake) section of the build instructions.
@@ -316,6 +283,7 @@ The folder structure mirrors other RAPIDS repos, with the following folders:
316
283
-`internal`: A private header-only component that hosts the code shared between benchmarks and tests.
317
284
-`scripts`: Helpful scripts for development
318
285
-`src`: Compiled APIs and template specializations for the shared libraries
286
+
-`template`: A skeleton template containing the bare-bones file structure and cmake configuration for writing applications with RAFT.
319
287
-`test`: Googletests source code
320
288
-`docs`: Source code and scripts for building library documentation (Uses breath, doxygen, & pydocs)
0 commit comments