Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ navigation:
path: "./pages/java_api/java-api-com-nvidia-cuvs-rowview.md"
- page: "SynchronizedCuVSResources"
path: "./pages/java_api/java-api-com-nvidia-cuvs-synchronizedcuvsresources.md"
- page: "VamanaIndex"
path: "./pages/java_api/java-api-com-nvidia-cuvs-vamanaindex.md"
- page: "VamanaIndexParams"
path: "./pages/java_api/java-api-com-nvidia-cuvs-vamanaindexparams.md"
- page: "BruteForceIndex"
path: "./pages/java_api/java-api-com-nvidia-cuvs-bruteforceindex.md"
- page: "BruteForceIndexParams"
Expand Down
2 changes: 2 additions & 0 deletions fern/pages/java_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ These pages are generated from the Java source files in `java/cuvs-java/src/main
- [LibraryException](/api-reference/java-api-com-nvidia-cuvs-libraryexception)
- [RowView](/api-reference/java-api-com-nvidia-cuvs-rowview)
- [SynchronizedCuVSResources](/api-reference/java-api-com-nvidia-cuvs-synchronizedcuvsresources)
- [VamanaIndex](/api-reference/java-api-com-nvidia-cuvs-vamanaindex)
- [VamanaIndexParams](/api-reference/java-api-com-nvidia-cuvs-vamanaindexparams)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two should probably go to the Nearest Neighbors section. Might require updating with this list

for token in (
"bruteforce",
"cagra",
"hnsw",
"ivf",
"tiered",
"searchresults",
"aceparams",


## Nearest Neighbors

Expand Down
46 changes: 30 additions & 16 deletions fern/pages/java_api/java-api-com-nvidia-cuvs-spi-cuvsprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ Creates a new CagraIndex Builder.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:135`_

### newVamanaIndexBuilder

```java
default VamanaIndex.Builder newVamanaIndexBuilder(CuVSResources cuVSResources) throws UnsupportedOperationException
```

Creates a new VamanaIndex Builder.

This is a `default` method rather than an abstract one so that
providers written against an earlier version of this interface keep
compiling.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:145`_

### newHnswIndexBuilder

```java
Expand All @@ -219,7 +233,7 @@ HnswIndex.Builder newHnswIndexBuilder(CuVSResources cuVSResources) throws Unsupp

Creates a new HnswIndex Builder.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:139`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:151`_

### hnswIndexFromCagra

Expand All @@ -246,7 +260,7 @@ A new HNSW index
| --- | --- |
| `Throwable` | if an error occurs during conversion |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:150`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:162`_

### hnswIndexBuild

Expand Down Expand Up @@ -274,7 +288,7 @@ A new HNSW index ready for search
| --- | --- |
| `Throwable` | if an error occurs during building |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:161`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:173`_

### newTieredIndexBuilder

Expand All @@ -284,7 +298,7 @@ TieredIndex.Builder newTieredIndexBuilder(CuVSResources cuVSResources) throws Un

Creates a new TieredIndex Builder.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:165`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:177`_

### isCagraPaddedDataset

Expand Down Expand Up @@ -317,7 +331,7 @@ true when the rows are already padded the way CAGRA requires
| --- | --- |
| `UnsupportedOperationException` | if this provider cannot answer |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:182`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:194`_

### mergeCagraIndexes

Expand Down Expand Up @@ -347,7 +361,7 @@ A new merged CAGRA index
| --- | --- |
| `Throwable` | if an error occurs during the merge operation |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:198`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:210`_

### newFilterBitsetHandle

Expand All @@ -364,7 +378,7 @@ Per-partition bit offsets are recomputed inside cuVS from the index sizes.
| --- | --- |
| `combinedLongs` | packed bitset words for a single partition |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:207`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:219`_

### searchCagraMultiPartition

Expand All @@ -390,7 +404,7 @@ Searches multiple CAGRA index partitions for the global top-k nearest neighbors
| --- | --- |
| `Throwable` | if an error occurs during the search |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:220`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:232`_

### gpuInfoProvider

Expand All @@ -400,7 +414,7 @@ GPUInfoProvider gpuInfoProvider()

Returns a `GPUInfoProvider` to query the system for GPU related information

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:229`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:241`_

### enableRMMPooledMemory

Expand All @@ -426,7 +440,7 @@ concurrent construction of that class from multiple threads.
| `initialPoolSizePercent` | The initial pool size, in percentage of the total GPU memory |
| `maxPoolSizePercent` | The maximum pool size, in percentage of the total GPU memory |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:250`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:262`_

### enableRMMManagedPooledMemory

Expand All @@ -447,7 +461,7 @@ Ownership: see `#enableRMMPooledMemory`.
| `initialPoolSizePercent` | The initial pool size, in percentage of the total GPU memory |
| `maxPoolSizePercent` | The maximum pool size, in percentage of the total GPU memory |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:262`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:274`_

### enableRMMAsyncMemory

Expand All @@ -464,7 +478,7 @@ launches. This operation has a global effect and will affect all resources on th

Ownership: see `#enableRMMPooledMemory`.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:274`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:286`_

### resetRMMPooledMemory

Expand All @@ -476,7 +490,7 @@ Disables pooled memory on the current device, reverting back to the default sett

Ownership: see `#enableRMMPooledMemory`.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:281`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:293`_

### provider

Expand All @@ -486,7 +500,7 @@ static CuVSProvider provider()

Retrieves the system-wide provider.

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:284`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:296`_

### cagraIndexParamsFromHnswParams

Expand Down Expand Up @@ -516,7 +530,7 @@ may be shifted along the curve right or left. See the heuristics descriptions fo

A new CAGRA index parameters object

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:304`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:316`_

### cagraIndexParamsFromDataset

Expand All @@ -540,6 +554,6 @@ Create CAGRA index parameters heuristically tuned for a dataset.

A new CAGRA index parameters object

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:322`_
_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:334`_

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/spi/CuVSProvider.java:18`_
201 changes: 201 additions & 0 deletions fern/pages/java_api/java-api-com-nvidia-cuvs-vamanaindex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
---
slug: api-reference/java-api-com-nvidia-cuvs-vamanaindex
---

# VamanaIndex

_Java package: `com.nvidia.cuvs`_

```java
public interface VamanaIndex extends AutoCloseable
```

`VamanaIndex` encapsulates a Vamana index, along with methods to build
it on the GPU and serialize it in the DiskANN file format.

Vamana is the graph construction algorithm behind DiskANN. cuVS currently
provides build and serialize only. There is no Vamana search API, so a
serialized index is searched by loading it with DiskANN.

## Public Members

### getDimensions

```java
int getDimensions() throws Throwable
```

Gets the dimensionality of the vectors in this index.

**Returns**

the number of dimensions

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:30`_

### serialize

```java
default void serialize(Path filePrefix) throws Throwable
```

Serializes the index in the DiskANN file format, including the dataset.

This writes two files, `filePrefix` holding the graph and
`filePrefix + ".data"` holding the dataset.

**Parameters**

| Name | Description |
| --- | --- |
| `filePrefix` | the prefix that output file names are derived from |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:40`_

### serialize

```java
void serialize(Path filePrefix, boolean includeDataset) throws Throwable
```

Serializes the index in the DiskANN file format.

When `includeDataset` is true this writes `filePrefix` holding
the graph and `filePrefix + ".data"` holding the dataset. When it is
false only `filePrefix` is written.

The argument is a prefix and not a complete file name, matching the native
`file_prefix` parameter.

**Parameters**

| Name | Description |
| --- | --- |
| `filePrefix` | the prefix that output file names are derived from |
| `includeDataset` | whether to write the dataset alongside the graph |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:57`_

### getCuVSResources

```java
CuVSResources getCuVSResources()
```

Gets an instance of `CuVSResources`

**Returns**

an instance of `CuVSResources`

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:64`_

### newBuilder

```java
static Builder newBuilder(CuVSResources cuvsResources)
```

Creates a new Builder with an instance of `CuVSResources`.

**Parameters**

| Name | Description |
| --- | --- |
| `cuvsResources` | an instance of `CuVSResources` |

**Throws**

| Type | Description |
| --- | --- |
| `UnsupportedOperationException` | if the provider does not support cuvs |

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:72`_

### withDataset

```java
Builder withDataset(float[][] vectors)
```

Sets the dataset for building the `VamanaIndex`.

**Parameters**

| Name | Description |
| --- | --- |
| `vectors` | a two-dimensional float array |

**Returns**

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:88`_

### withDataset

```java
Builder withDataset(CuVSMatrix dataset)
```

Sets the dataset for building the `VamanaIndex`.

The native builder accepts `float`, `half`, `uint8`,
and `int8` datasets. Of those, `CuVSMatrix.DataType#FLOAT`,
`CuVSMatrix.DataType#HALF`, and `CuVSMatrix.DataType#BYTE`
are reachable from Java today, where `BYTE` is unsigned.
`int8` has no corresponding `DataType`.

The native index may retain a non-owning device view of the dataset
rather than copying it, so the caller must keep this matrix open for at
least as long as the index and close it afterwards. A dataset supplied as
a `float[][]` is created and closed by the index instead.

**Parameters**

| Name | Description |
| --- | --- |
| `dataset` | a `CuVSMatrix` object containing the vectors |

**Returns**

an instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:107`_

### withIndexParams

```java
Builder withIndexParams(VamanaIndexParams vamanaIndexParameters)
```

Registers an instance of configured `VamanaIndexParams` with this
Builder.

**Parameters**

| Name | Description |
| --- | --- |
| `vamanaIndexParameters` | An instance of VamanaIndexParams |

**Returns**

An instance of this Builder

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:116`_

### build

```java
VamanaIndex build() throws Throwable
```

Builds and returns an instance of `VamanaIndex`.

**Returns**

an instance of `VamanaIndex`

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:123`_

_Source: `java/cuvs-java/src/main/java/com/nvidia/cuvs/VamanaIndex.java:21`_
Loading
Loading