Skip to content

New Dataset API Clarifying Ownership #2 - #2391

Open
HowardHuang1 wants to merge 84 commits into
NVIDIA:mainfrom
HowardHuang1:HH-Dataset-API
Open

New Dataset API Clarifying Ownership #2#2391
HowardHuang1 wants to merge 84 commits into
NVIDIA:mainfrom
HowardHuang1:HH-Dataset-API

Conversation

@HowardHuang1

Copy link
Copy Markdown
Contributor

Builds upon PR #1846 which has already been merged in.

HowardHuang1 and others added 30 commits July 27, 2026 10:21
… vs padded datasets)

Introduces the new Dataset API at the C++ API layer and migrates all consumers (C API, Python,
Go, Java, benchmarks, examples, faiss patch) to the new dataset API. Now downstream functions including build, search, extend, merge, serialize/deserialize, etc. all take in new dataset API rather than mdspan at the C++ API layer and DLPack at the C layer. Old inheritance hierarchy for Dataset API is replaced with composition with templates."
Add dispatch on Layout and MemType params within one single centralized build function rather than adding build function overloads with different names at C API layer.
Add lifetime-tracked dataset views and keep deserialized storage coupled to its index handle. This aligns Rust with the new C dataset API and prevents dangling dataset references.
Split the `cagra::index_params::from_hnsw_params` into a core `cagra::index_params::from_dataset` and a thin wrapper ``cagra::index_params::from_hnsw_params`. This solves two problems:
1. Avoid using the HNSW parameters that do not make sense for CAGRA
2. Allow HNSW parameter heuristics change without affecting CAGRA in future

The new parameter defaults are selected to yield exactly the same configurations at old call sites of `from_hnsw_params`

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Tamas Bela Feher (https://github.com/tfeher)

URL: NVIDIA#2345
…unction that took mdspan. Restore code that calls make_device_padded_dataset() factory within build_ace() and call build_from_device_matrix() instead. This fixes build issue.
… to rename. Now updated to use new factory names
…I. Host vs device is no longer specified in the factory itself. Rather, host vs device is dispatched at the C API layer. If input data is on host, factory returns a host dataset. If input data is on device, factory returns a device dataset. This allowed us to consolidate several dispatch branches in the language wrappers.
HowardHuang1 and others added 13 commits July 30, 2026 17:22
…originates on host. Merge() can no longer merge host data. Merge() only takes data on device
… OOM. However, we should re-evaluate this because I don't think this is good for the new DtasetAPI as the index return type can now be host index when GPU hits OOM but the user still expects device index. With the new templating on the datasets and indexes, this can cause user/caller confusion.
…earch. TODO: need to revisit this later. This is a temporary patch to fix failing java tests and avoid exposing a public tiered index update dataset function for users. Instead we use CAGRA's existing update dataset functions and keep it tiered index's responsibility to call this internally rather than leaving the responsibility to the users
Update C Tests to Use Getters
… padded datasets onto host or standard indexes prior to search within Java tests.
…ndexImpl.java

Co-authored-by: Igor Motov <igor@motovs.org>
…ndexImpl.java

Co-authored-by: Igor Motov <igor@motovs.org>
@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cjnolet cjnolet added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jul 31, 2026
@cjnolet

cjnolet commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

/ok to test 5b1bd3c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

7 participants