Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fd9bca9
Add target alpha ACE augmentation
julianmi Sep 22, 2026
d6909fd
Merge remote-tracking branch 'upstream/main' into ace-target-alpha
julianmi Oct 2, 2026
3732b48
Add missing Java and Rust bindings
julianmi Oct 2, 2026
62e1a9f
Merge branch 'main' into ace-target-alpha
julianmi Oct 2, 2026
c7b46c2
Merge branch 'main' into ace-target-alpha
julianmi Oct 5, 2026
ba930cc
Merge branch 'main' into ace-target-alpha
julianmi Oct 9, 2026
dcabdb4
Merge branch 'main' into ace-target-alpha
julianmi Oct 12, 2026
83915d7
Reject ACE spill counts that overflow index offsets
julianmi Oct 12, 2026
bb828af
Subsample tied ACE margin scores to respect the target budget
julianmi Oct 12, 2026
ce93d3e
Skip spill scoring and its partition cap for core-only ACE builds
julianmi Oct 12, 2026
ffe0d2e
Budget ACE labeling GPU buffers before creating disk artifacts
julianmi Oct 12, 2026
697bb51
Document ACE target alpha limits across language APIs
julianmi Oct 12, 2026
0b3ecfc
Exercise ACE alpha validation and zero and multi-spill builds
julianmi Oct 12, 2026
44d969b
Document ACE budget helpers and Python alpha accessors
julianmi Oct 12, 2026
983e517
Merge remote-tracking branch 'upstream/main' into fix/2698-review
julianmi Oct 13, 2026
c8b72b0
Merge remote-tracking branch 'upstream/main' into fix/2698-review
julianmi Oct 13, 2026
a4a6caa
Fix implementation include paths for CAGRA helper tests
julianmi Oct 13, 2026
e8554ab
Add private dependencies required by CAGRA helper tests
julianmi Oct 13, 2026
3bfb56f
Use feasible budgets in ACE host-memory fallback tests
julianmi Oct 13, 2026
4be684c
Merge upstream/main and adapt ACE alpha budgets to the extracted header
julianmi Oct 15, 2026
0308314
Simplify ACE score storage and reuse budget and parameter checks
julianmi Oct 16, 2026
d977515
Merge remote-tracking branch 'upstream/main' into ace-target-alpha
julianmi Oct 16, 2026
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
8 changes: 8 additions & 0 deletions c/include/cuvs/neighbors/cagra.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ struct cuvsAceParams {
* Useful for testing or when running alongside other memory-intensive processes.
*/
double max_gpu_memory_gb;
/**
* Target number of augmented (spill) copies per input vector.
* A value of 0 disables augmentation. The default is 1.0.
* Must be finite and in [0, min(3, N - 1)], where N is the effective partition
* count after build-time adjustment.
* This is an expected budget; sampling can change the realized spill count.
*/
double target_alpha;
Comment thread
julianmi marked this conversation as resolved.
};

typedef struct cuvsAceParams* cuvsAceParams_t;
Expand Down
8 changes: 8 additions & 0 deletions c/include/cuvs/neighbors/hnsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ struct cuvsHnswAceParams {
* Useful for testing or when running alongside other memory-intensive processes.
*/
double max_gpu_memory_gb;
/**
* Target number of augmented (spill) copies per input vector.
* A value of 0 disables augmentation. The default is 1.0.
* Must be finite and in [0, min(3, N - 1)], where N is the effective partition
* count after build-time adjustment.
* This is an expected budget; sampling can change the realized spill count.
*/
double target_alpha;
};

typedef struct cuvsHnswAceParams* cuvsHnswAceParams_t;
Expand Down
7 changes: 6 additions & 1 deletion c/src/neighbors/cagra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ static void _set_graph_build_params(
ace_p.use_disk = ace_params_c->use_disk;
ace_p.max_host_memory_gb = ace_params_c->max_host_memory_gb;
ace_p.max_gpu_memory_gb = ace_params_c->max_gpu_memory_gb;
ace_p.target_alpha = ace_params_c->target_alpha;
}
out_params = ace_p;
break;
Expand Down Expand Up @@ -1463,6 +1464,9 @@ static void _populate_cagra_index_params_from_cpp(cuvsCagraIndexParams_t c_param
c_ace_params->ef_construction = ace_params.ef_construction;
c_ace_params->build_dir = ace_params.build_dir.empty() ? nullptr : strdup(ace_params.build_dir.c_str());
c_ace_params->use_disk = ace_params.use_disk;
c_ace_params->max_host_memory_gb = ace_params.max_host_memory_gb;
c_ace_params->max_gpu_memory_gb = ace_params.max_gpu_memory_gb;
c_ace_params->target_alpha = ace_params.target_alpha;
c_params->graph_build_params = c_ace_params;
}
}
Expand Down Expand Up @@ -2341,7 +2345,8 @@ extern "C" cuvsError_t cuvsAceParamsCreate(cuvsAceParams_t* params)
.build_dir = build_dir,
.use_disk = ps.use_disk,
.max_host_memory_gb = ps.max_host_memory_gb,
.max_gpu_memory_gb = ps.max_gpu_memory_gb};
.max_gpu_memory_gb = ps.max_gpu_memory_gb,
.target_alpha = ps.target_alpha};
});
}

Expand Down
4 changes: 3 additions & 1 deletion c/src/neighbors/hnsw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void _build(cuvsResources_t res,
ace_params.use_disk = params->ace_params->use_disk;
ace_params.max_host_memory_gb = params->ace_params->max_host_memory_gb;
ace_params.max_gpu_memory_gb = params->ace_params->max_gpu_memory_gb;
ace_params.target_alpha = params->ace_params->target_alpha;
cpp_params.graph_build_params = ace_params;
}

Expand Down Expand Up @@ -161,7 +162,8 @@ extern "C" cuvsError_t cuvsHnswAceParamsCreate(cuvsHnswAceParams_t* params)
.build_dir = "/tmp/hnsw_ace_build",
.use_disk = false,
.max_host_memory_gb = 0,
.max_gpu_memory_gb = 0};
.max_gpu_memory_gb = 0,
.target_alpha = 1.0};
});
}

Expand Down
22 changes: 11 additions & 11 deletions cpp/bench/ann/src/cuvs/cuvs_ann_bench_param_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ void parse_build_param(const nlohmann::json& conf, cuvs::neighbors::cagra::index
} else if constexpr (std::is_same_v<U,
cuvs::neighbors::graph_build_params::nn_descent_params>) {
parse_build_param<T, IdxT>(nn_descent_conf, arg);
} else if constexpr (std::is_same_v<U, cuvs::neighbors::graph_build_params::ace_params>) {
if (ace_conf.contains("npartitions")) { arg.npartitions = ace_conf.at("npartitions"); }
if (ace_conf.contains("build_dir")) { arg.build_dir = ace_conf.at("build_dir"); }
if (ace_conf.contains("ef_construction")) {
arg.ef_construction = ace_conf.at("ef_construction");
}
if (ace_conf.contains("use_disk")) { arg.use_disk = ace_conf.at("use_disk"); }
if (ace_conf.contains("target_alpha")) { arg.target_alpha = ace_conf.at("target_alpha"); }
}
},
params.graph_build_params);
Expand Down Expand Up @@ -466,17 +474,9 @@ void parse_build_param(const nlohmann::json& conf,
} else if (conf.value("graph_build_algo", "") == "ACE") {
cagra_params.graph_build_params = cuvs::neighbors::cagra::graph_build_params::ace_params{};
}
// Parse ACE parameters if provided
nlohmann::json ace_conf = collect_conf_with_prefix(conf, "ace_");
if (!ace_conf.empty()) {
auto ace_params = cuvs::neighbors::cagra::graph_build_params::ace_params();
if (ace_conf.contains("npartitions")) { ace_params.npartitions = ace_conf.at("npartitions"); }
if (ace_conf.contains("build_dir")) { ace_params.build_dir = ace_conf.at("build_dir"); }
if (ace_conf.contains("ef_construction")) {
ace_params.ef_construction = ace_conf.at("ef_construction");
}
if (ace_conf.contains("use_disk")) { ace_params.use_disk = ace_conf.at("use_disk"); }
cagra_params.graph_build_params = ace_params;
// Preserve ACE precedence among prefixed configs; the shared parser applies the values.
if (!collect_conf_with_prefix(conf, "ace_").empty()) {
cagra_params.graph_build_params = cuvs::neighbors::cagra::graph_build_params::ace_params{};
}
::parse_build_param<T, IdxT>(conf, cagra_params);
return cagra_params;
Expand Down
13 changes: 13 additions & 0 deletions cpp/include/cuvs/neighbors/cagra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,19 @@ struct ace_params {
*/
double max_gpu_memory_gb = 0;

/**
* Target number of augmented (spill) copies per input vector.
*
* ACE samples boundary-margin scores and chooses a global threshold whose expected
* augmentation ratio matches this value. A value of 0 disables augmentation. Values above 1
* allow a vector to spill into multiple nearby partitions. The implementation bounds each
* vector to three spill partitions to keep memory and build work predictable.
* Must be finite and in [0, min(3, N - 1)], where N is the effective partition count
* after build-time adjustment. Sampling can change
* the realized spill count; the target is not a strict allocation bound.
*/
double target_alpha = 1.0;

ace_params() = default;
};

Expand Down
Loading
Loading