Expose Vamana build and serialize through cuvs-java - #2555
Open
shaunakkapur wants to merge 2 commits 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
The previous run failed in conda-cpp-build on a RAFT and ucxx mismatch in the build environment, unrelated to this PR. Upstream main has since built green, so this empty commit re-runs the checks against current packages.
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
All 19 tests in
VamanaBuildAndSerializeITpass in CI on both CUDA 12.9 and 13.3, alongside the existing unit tests, the Lucene build, and the C++ matrix. The suite covers float32 and unsigned byte builds, float16 on a device-backed matrix, both serialization modes, the DiskANN file layout assertions,L2SqrtExpanded, parameter validation against the nativeRAFT_EXPECTSchecks, dataset ownership, and lifecycle.Also verified locally against a
libcuvs.sobuilt from currentmain:mvn verify, 19 of 19 plus the existing unit testsmvn spotless:checkandci/checks/run_spotless.sh, no rewritesjavadoc:javadocwithdoclint all,-missingcuvs-lucenetest-compileagainst the installed jarAn earlier run failed in
conda-cpp-buildon a RAFT and ucxx mismatch in the build environment, inraft/comms/detail/std_comms.hpp. That was unrelated to this PR, which contains no C++ or CMake changes, and it has since been resolved upstream.