Commit 9fc1cfd
authored
Add HNSW ACE build method (#1597)
This PR adds a direct `hnsw::build` API that uses the ACE (Augmented Core Extraction) algorithm to build HNSW indexes on the GPU. ACE enables building HNSW indexes for datasets too large to fit in GPU memory by partitioning the data and building sub-indexes.
CC @tfeher
**C++ API**
- Added `hnsw::build()` function with ACE parameters for direct HNSW index construction. This serializes an HNSW index to disk if `use_disk` is true.
- Added `hnsw::graph_build_params::ace_params` struct with configurable options:
- `npartitions` - number of partitions for parallel build
- `ef_construction` - index quality parameter
- `build_dir` - directory for disk-based build artifacts
- `use_disk` - force disk-based storage mode
- Implemented proper serialization/deserialization for disk-backed HNSW indexes
- Added C++ tests in `ann_hnsw_ace.cuh`
**C API**
- Added `cuvsHnswBuild` function with ACE parameters
- Added C tests in `ann_hnsw_ace.cu`
**Python**
- Added `hnsw.AceParams` class for configuring ACE builds
- Added Python tests in `test_hnsw_ace.py`
**Java**
- Added `HnswAceParams` class
- Added Java tests in `HnswAceBuildAndSearchIT.java`
**Documentation**
- Added `cuvs_hnsw` section to the parameter tuning guide with ACE parameters
**Example**
- Added `hnsw_ace_example.cu` demonstrating the build → deserialize → search workflow
Authors:
- Julian Miller (https://github.com/julianmi)
- Tamas Bela Feher (https://github.com/tfeher)
Approvers:
- Tamas Bela Feher (https://github.com/tfeher)
- Robert Maynard (https://github.com/robertmaynard)
- Divye Gala (https://github.com/divyegala)
- MithunR (https://github.com/mythrocks)
URL: #15971 parent 2987eb2 commit 9fc1cfd
38 files changed
Lines changed: 2663 additions & 442 deletions
File tree
- cpp
- include/cuvs/neighbors
- src/neighbors
- detail
- cagra
- tests
- neighbors
- ann_cagra_ace
- ann_hnsw_ace
- c
- include/cuvs/neighbors
- src/neighbors
- tests/neighbors
- docs/source/cuvs_bench
- examples/cpp
- src
- java/cuvs-java/src
- main
- java22/com/nvidia/cuvs
- internal
- spi
- java/com/nvidia/cuvs
- spi
- test/java/com/nvidia/cuvs
- python/cuvs/cuvs
- neighbors
- cagra
- hnsw
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 254 | | |
271 | 255 | | |
272 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
39 | 83 | | |
40 | 84 | | |
41 | 85 | | |
| |||
49 | 93 | | |
50 | 94 | | |
51 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
52 | 107 | | |
53 | 108 | | |
54 | 109 | | |
| |||
203 | 258 | | |
204 | 259 | | |
205 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
206 | 332 | | |
207 | 333 | | |
208 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
26 | 56 | | |
27 | 57 | | |
28 | 58 | | |
| |||
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
121 | 165 | | |
122 | 166 | | |
123 | 167 | | |
124 | | - | |
125 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
126 | 174 | | |
127 | 175 | | |
128 | 176 | | |
| |||
213 | 261 | | |
214 | 262 | | |
215 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
216 | 287 | | |
217 | 288 | | |
218 | 289 | | |
| |||
0 commit comments