What is hipRAFT?

What is hipRAFT?#

2025-11-11

3 min read time

Applies to Linux

hipRAFT is a library of functions for machine learning and data mining. It is AMD’s ROCm-native port of NVIDIA® RAPIDS® RAFT: a collection of reusable, GPU-accelerated C++/Python primitives (distance, reductions, neighbors, graph, sparse/dense linalg, etc.) built with HIP for AMD Instinct GPUs. It provides RAFT-compatible APIs so data-science and ML libraries (e.g., vector search, clustering, graph analytics) can run efficiently on ROCm without code rewrites. While not exhaustive, the following table summarizes the accelerated functions in hipRAFT:

Module

Headers

Description

Core

cpp/include/raft/core/*

  • Spans, buffers, and memory allocation policies and containers.
  • GPU Resource Management – Streams, events, device properties.
  • Logging & Debugging – Logging macros, profiling utilities.
  • Sparse Dense Matrix Abstractions – COO and CSR matrix handling.
  • Known issues:
    • The API in raft/core/interruptible.hpp are not supported.

Label

cpp/include/raft/label/*

These APIs provide functionalities for handling and processing class labels in machine learning and graph-based algorithms. They focus on extracting unique labels, mapping labels to a monotonically increasing order, and merging different label sets.

Linear Algebra

cpp/include/raft/linalg/*

APIs that abstract common BLAS routines, standard linear system solvers, factorization and eigenvalue solvers.

  • Known issues:
    • raft::linalg::randomized_svd is not supported.

Matrix

cpp/include/raft/matrix/*

The hipRAFT matrix API extends matrix operations beyond raft::linalg, offering utilities for arithmetic (power, ratio, reciprocal, sign-flip, square root), manipulation (initialization, reversing, thresholding), ordering (argmax, argmin, select-K, sorting), and reductions (matrix norms).

Solver

cpp/include/raft/solver/*

Solvers supported:

  • LinearAssignmentProblem solver(alternating tree Hungarian Algorithm) from cpp/include/raft/solver/linear_assignment.cuh
  • Minimum spanning tree solver is supported from cpp/include/raft/sparse/mst/mst.hpp

Sparse

cpp/include/raft/sparse/*

Provides GPU-accelerated operations for sparse matrices, including arithmetic, normalization, multiplication, slicing, and solvers for eigenvalues and graph problems, optimizing large-scale computations.

  • Known issues:
    • raft::sparse::linalg::masked_matmul is not supported for half type.

Utilities

cpp/include/raft/util/*

Miscellaneous utility/helper functions

Common

cpp/include/raft/common/*

Miscellaneous common functions used across various modules.

Random

cpp/include/raft/random/*

Miscellaneous functions for random number generation.

  • Known issues:
    • raft::random::make_regression is not supported for the double type.