raft
RAFT contains fundamental widely-used algorithms and primitives for machine learning and information retrieval. The algorithms are CUDA-accelerated and form bui
What is raft?
RAFT contains fundamental widely-used algorithms and primitives for machine learning and information retrieval. The algorithms are CUDA-accelerated and form building blocks for more easily writing high performance applications.
Overview of raft
What it is
RAFT (Reusable Accelerated Functions and Tools) is a C++ header-only template library containing fundamental widely-used algorithms and primitives for machine learning and data mining. The algorithms are CUDA-accelerated and form building blocks for writing high performance applications. RAFT also provides two Python libraries: pylibraft (lightweight wrappers around host-accessible runtime APIs) and raft-dask (multi-node multi-GPU communicator infrastructure for distributed algorithms with Dask).
Key features
- CUDA-accelerated algorithms and primitives for machine learning and information retrieval.
- Primitives-based approach to accelerate algorithm construction and reduce maintenance burden.
- Header-only C++ template library with optional shared library for faster compile times and runtime APIs.
- Supports multi-dimensional arrays via mdspan and mdarray, with memory management using memory resources from CCCL or RMM.
- Python libraries: pylibraft for lightweight Python wrappers and raft-dask for distributed multi-GPU computing.
- Interoperable with other libraries via cuda_array_interface and DLPack (CuPy, PyTorch, JAX, TensorFlow, cuDF).
Use cases
- Building high performance CUDA-accelerated applications for machine learning and data mining.
- Accelerating information retrieval algorithms and workflows.
- Developing custom algorithms using reusable primitives for dense and sparse operations, solvers, statistics, and utilities.
- Multi-node multi-GPU distributed computing with Dask.
Getting started
See the repository README for installation instructions. The library provides C++ and Python APIs. Below is a brief example of using the C++ API to compute pairwise distances: c++ #include #include #include #include raft::device_resources handle; int n_samples = 5000; int n_features = 50; auto input_view = raft::make_device_matrix_view(input, n_samples, n_features); auto labels_view = raft::make_device_vector_view(labels, n_samples); auto output_view = raft::make_device_matrix_view(output, n_samples, n_samples); raft::random::make_blobs(handle, input_view, labels_view); auto metric = cuvs::distance::DistanceType::L2SqrtExpanded; cuvs::distance::pairwise_distance(handle, input_view, input_view, output_view, metric);
License and pricing
Apache-2.0 license. Open source.
Based on the project's public README and repository metadata.