NVIDIA / NVIDIA/cuvs

[FEA] golang API for index serialization back to CPU

Open
#1,592 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I wish I could use RAFT to do [...]

All indexes like cagra, ivf_flat, ivf_pg, ... have similar issue that is without serialization functions to CPU in golang APIs.

e.g. golang ivf_flat API only hav 3 functions CreateIndex, BuildIndex and SearchIndex. There is
no function to serialize the index back to CPU just like C api does.

C APIs

/**
 * @brief De-allocate IVF-Flat index
 *
 * @param[in] index cuvsIvfFlatIndex_t to de-allocate
 */
cuvsError_t cuvsIvfFlatIndexDestroy(cuvsIvfFlatIndex_t index);

/** Get the number of clusters/inverted lists */
cuvsError_t cuvsIvfFlatIndexGetNLists(cuvsIvfFlatIndex_t index, int64_t* n_lists);

/** Get the dimensionality of the data */
cuvsError_t cuvsIvfFlatIndexGetDim(cuvsIvfFlatIndex_t index, int64_t* dim);

/**
 * @brief Get the cluster centers corresponding to the lists [n_lists, dim]
 *
 * @param[in] index cuvsIvfFlatIndex_t Built Ivf-Flat Index
 * @param[out] centers Preallocated array on host or device memory to store output, [n_lists, dim]
 * @return cuvsError_t
 */
cuvsError_t cuvsIvfFlatIndexGetCenters(cuvsIvfFlatIndex_t index, DLManagedTensor* centers);

Describe the solution you'd like
A clear and concise description of what you want to happen.

Complete the golang API to match with C, Rust and Python for all indexes.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context, code examples, or references to existing implementations about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the Go IVF-Flat entry points CreateIndex, BuildIndex, and SearchIndex with the C API functions and the existing Rust and Python APIs. Done means the Go API provides serialization-back-to-CPU and matching index accessors for all indexes, including the C API's destroy, list-count, dimension, and centers operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.