Expose Vamana build and serialize through cuvs-java - #2555
Open
shaunakkapur wants to merge 1 commit into
Open
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
cuVS provides a GPU Vamana builder and DiskANN-compatible serialization, and the generated Panama bindings for it already exist in cuvs-java, but there is no public API, so nothing can call Vamana from Java. This adds VamanaIndex and VamanaIndexParams beside CagraIndex. Scope is build and serialize only, matching the native surface. cuVS exposes no Vamana search entry point, so neither does this. serialize takes a Path prefix rather than an OutputStream, because one native call writes two files, the graph at the prefix and the dataset at prefix + ".data". VamanaIndexParams.Builder mirrors the native RAFT_EXPECTS checks so an invalid configuration fails in Java with a readable message instead of inside a GPU kernel. The native index may retain a non-owning device view of the dataset, so the index holds a reference to keep it alive and closes it only when it created the matrix from a float[][]. newVamanaIndexBuilder is added to CuVSProvider as a default method rather than an abstract one so that providers written against an earlier version of the interface keep compiling.
shaunakkapur
force-pushed
the
feat/java-vamana-index
branch
from
September 4, 2026 19:33
40d7748 to
b7ecf25
Compare
shaunakkapur
marked this pull request as ready for review
September 4, 2026 19:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a public
cuvs-javaAPI for building and serializing Vamana indexes using the generated Panama bindings that already exist.The API follows the existing CAGRA provider pattern:
VamanaIndexexposes build, dimensions, and DiskANN serialization.VamanaIndexParamsexposes the native build parameters with Java-side validation.VamanaIndexImplowns the native handle and preserves the lifetime of a dataset view.CuVSProvider,JDKProvider, andUnsupportedProviderexpose the new builder.serialize(Path filePrefix, boolean includeDataset)intentionally accepts a path prefix because the native call can write the graph at that prefix and the dataset at<prefix>.data.The integration tests cover supported host and device datatypes, both native L2 metrics, dimensions, serialization layout, parameter validation, and resource ownership. This includes the float16 and device-backed paths added by the current native Vamana implementation.
Scope
This PR is build-and-serialize only. It does not add Vamana search, deserialization,
sector_aligned, AiSAQ layout changes, orcuvs-luceneintegration because those capabilities are not exposed by the current Vamana C API or belong to later work.Testing
mvn verifypassed for the earlier 15-test Vamana suite plus the existing unit tests.mvn spotless:checkpassed.ci/checks/run_spotless.shpassed without rewrites.cuvs-lucenetest compilation passed against the locally installed jar.L2SqrtExpanded, and infinity validation—are included in the 19-test suite. Full native execution of those additions is delegated to CI because the local C++ environment predates current Vamana fp16 support and cannot be rebuilt without newly required cuTile and cuFile development packages.