DEV.co
Vector Databases · NVIDIA

raft

RAFT is an NVIDIA-sponsored C++ library providing GPU-accelerated primitives for machine learning—linear algebra, clustering, nearest-neighbor search, and statistics. It offers optional Python bindings (pylibraft) and Dask integration for multi-GPU workflows, designed as building blocks rather than a direct data-science tool.

Source: GitHub — github.com/NVIDIA/raft
1k
GitHub stars
238
Forks
Cuda
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryNVIDIA/raft
OwnerNVIDIA
Primary languageCuda
LicenseApache-2.0 — OSI-approved
Stars1k
Forks238
Open issues447
Latest releasev26.06.00 (2026-06-03)
Last updated2026-07-08
Sourcehttps://github.com/NVIDIA/raft

What raft is

Header-only C++ template library with optional shared library, exposing dense/sparse linear algebra, solvers, statistics, and vector-search kernels via mdspan multi-dimensional arrays and raft::device_resources for stream/handle management. Python bindings support __cuda_array_interface__ for zero-copy interop with CuPy, PyTorch, and JAX.

Quickstart

Get the raft source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/NVIDIA/raft.gitcd raft# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

GPU-accelerated vector search and nearest-neighbor indexing

Core primitive for ANN, embeddings, and similarity search in production LLM and retrieval systems; exposed via cuVS distance computations and optimized kernels.

Building high-performance GPU applications with reusable components

Reduces time-to-market for custom ML pipelines by providing pre-optimized linear algebra, factorization, and sparse operations that avoid reimplementing standard routines.

Multi-GPU, multi-node distributed machine learning

raft-dask integration enables Dask-based workflows for horizontal scaling; RMM memory management simplifies allocation across GPUs.

Implementation considerations

  • Mandatory dependency on RAPIDS RMM for memory allocation; understand RMM pooling and allocation strategies to optimize performance.
  • mdspan and mdarray API requires modern C++ (C++17+); template compilation can be slow without using the optional shared library prebuilt types.
  • Handle and stream management via raft::device_resources; synchronization and kernel launch patterns differ from standard CUDA—review examples carefully.
  • Python bindings (pylibraft) are lightweight wrappers; inspect source for which algorithms are exposed; coverage growing but not exhaustive.
  • Multi-GPU code via raft-dask requires Dask cluster setup and NCCL communication; verify interop with target distributed frameworks (Ray, MPI).

When to avoid it — and what to weigh

  • CPU-only inference or training at scale — RAFT is GPU-first; CPU fallback is not a focus. Pure CPU workloads incur overhead and miss the core value proposition.
  • Data scientists needing high-level ML APIs — RAFT is intentionally low-level and primitives-focused; RAPIDS libraries (cuML, cuDF) are the intended abstraction layer for data science workflows.
  • Projects without CUDA expertise or GPU infrastructure — Requires CUDA compiler, cuBLAS, cuSOLVER, and modern NVIDIA GPUs; integration complexity is high for teams new to GPU development.
  • Scenarios requiring cross-vendor GPU support — CUDA-only; no AMD ROCm, Intel oneAPI, or other accelerator support.

License & commercial use

Licensed under Apache-2.0 (Apache License 2.0), a permissive OSI-approved license allowing commercial use, modification, and distribution with standard attribution and liability disclaimers.

Apache-2.0 is a permissive license that permits commercial use, including in proprietary applications, without requiring disclosure of source code modifications. No additional license fees or restrictions apply. However, as with all open-source dependencies, ensure your legal team reviews compliance obligations (e.g., attribution, liability limitation) before deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityHigh
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No critical vulnerabilities or exploit details found in provided data. Standard considerations: CUDA kernel execution is not memory-safe by default—bounds checking and input validation are developer responsibility. RMM and cuBLAS dependencies should be monitored for CVEs. No formal security audit details provided; review CVE databases and NVIDIA advisories before using in high-security environments.

Alternatives to consider

FAISS (Meta) + CuPy / Rapids cuML

Pure vector-search focus with simpler Python API; cuML provides higher-level ML algos. Less general-purpose than RAFT's primitives approach.

Thrust (NVIDIA standard library)

Lower-level CUDA primitives; more manual but directly integrated into NVIDIA toolkit. Lacks ML-specific algorithms and RMM convenience.

oneAPI / Intel GPU libraries

Cross-vendor GPU acceleration; less mature for ML workflows but no NVIDIA lock-in. Smaller ecosystem compared to CUDA/RAPIDS.

Software development agency

Build on raft with DEV.co software developers

Evaluate RAFT's GPU primitives for your use case. Start with the getting-started guide and assess GPU infrastructure requirements. Devco can help architect and integrate RAFT into your production pipeline.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

raft FAQ

Is RAFT a complete ML framework?
No. RAFT provides low-level accelerated primitives (linear algebra, distance, statistics). For end-to-end data science, use RAPIDS libraries (cuML, cuDF) which build on RAFT.
Can I use RAFT without CUDA?
Functionally no. RAFT is GPU-centric. C++ host APIs exist but are thin wrappers; the library is optimized for and intended for CUDA-capable GPUs.
How do I avoid slow template compilation?
Use the optional shared library for common types (e.g., float32, float64), which precompiles templates. This reduces your project's compile time significantly.
Is RAFT production-ready?
Yes, for teams with GPU expertise. Active maintenance, Apache-2.0 license, and vendor backing support production use. Ensure performance testing and GPU memory profiling in your specific hardware.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like raft. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across vector databases and beyond.

Ready to accelerate your ML workload?

Evaluate RAFT's GPU primitives for your use case. Start with the getting-started guide and assess GPU infrastructure requirements. Devco can help architect and integrate RAFT into your production pipeline.