Skip to content

Binary dataset support in CAGRA (upstream #1906) #5

Description

@mohanprasand-nuvai

Context

Upstream rapidsai/cuvs#1906 requests binary dataset support in CAGRA — specifically, the ability to accept binary-quantized vectors with residual codes for ADC (asymmetric distance computation). This is a requirement from OpenSearch.

Upstream Dependency

This feature is blocked upstream on rapidsai/cuvs#1846 — a WIP PR that introduces a new padded_dataset API replacing strided_dataset, with support plumbed into CAGRA. Key design decisions in NVIDIA#1846:

  1. Users should not need to know about dataset padding internals — padded_dataset handles it
  2. Graph-based APIs (CAGRA, Vamana) should accept pre-quantized data (e.g., PQ with codebooks) rather than performing their own quantization — decouples quantization from the algorithm
  3. Memory ownership stays with the user, not the algorithm

Status (as of 2026-03-23): PR NVIDIA#1846 is still open and marked WIP. Last activity: March 4, 2026.

Decision Needed

Two options:

Option A: Cherry-pick NVIDIA#1846 + implement NVIDIA#1906

Option B: From-scratch implementation

Option C: Hybrid — minimal dataset abstraction now, align later

Scope (for any option)

  • Binary dataset type (packed bit vectors, likely uint8_t storage with N vectors of D bits → [N × ceil(D/8)] uint8 matrix)
  • Hamming distance computation for CAGRA search kernels
  • CAGRA build with binary data (likely using float-promoted intermediate graph, similar to int8/bf16 pattern)
  • C-API dispatch for binary datasets
  • Rust/Go bindings

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions