
Default parameters for the GPU nearest neighbour backends
params_knn_gpu_defaults.RdGPU sibling of bixverse::params_knn_defaults(). The GPU
indices take a different knob set: there is no Annoy and no HNSW on the
device, so what survives is exhaustive, IVF and NN-descent.
Value
A named list with the following elements:
k - Integer. Number of neighbours.
0Lhands the choice to Rust, which usessqrt(n_cells) * 0.5and then adjusts for the simulated doublets. Defaults to15L.knn_method - String. The GPU index to use. One of
c("exhaustive", "ivf", "nndescent"). Defaults to"exhaustive".ann_dist - String. Manhattan is not supported by the GPU kernels. One of
c("euclidean", "cosine"). Defaults to"euclidean".n_list - Integer or
NULL. IVF only. Number of clusters.NULLgivessqrt(n). Defaults toNULL.n_probe - Integer or
NULL. IVF only. Clusters to probe.NULLgivessqrt(n_list). Defaults toNULL.graph_k - Integer or
NULL. NN-descent only. Node degree of the graph after pruning.NULLgives 30, widened to coverkwhenextract_knnis set. Defaults toNULL.k_build - Integer or
NULL. NN-descent only. Build degree before pruning.NULLgivesmax(k, floor(1.5 * k)). Defaults toNULL.n_tree - Integer or
NULL. NN-descent only. Trees seeding the descent. Defaults toNULL.delta - Numeric. NN-descent only. Termination criterium for the descent. Defaults to
0.001.rho - Numeric or
NULL. NN-descent only. Sampling rate for the descent. Defaults toNULL.refine_knn - Integer or
NULL. NN-descent only. 2-hop refinement sweeps after the descent. Buys graph quality at a linear cost.NULLgives 0. Defaults toNULL.beam_width - Integer or
NULL. NN-descent only. Beam width when querying. Ignored whenextract_knnis set. Defaults toNULL.max_beam_iters - Integer or
NULL. NN-descent only. Beam search iterations. Ignored whenextract_knnis set. Defaults toNULL.n_entry_points - Integer or
NULL. NN-descent only. Entry points when querying. Ignored whenextract_knnis set. Defaults toNULL.extract_knn - Boolean. NN-descent only. Hand back the graph the descent built instead of beam searching over it. Defaults to
FALSE.
Details
NN-descent builds a CAGRA graph and, with extract_knn = TRUE, hands that
graph back rather than beam searching over it. Note that this saves the
query, not the build: the descent itself dominates, and its build degree
tracks k. NN-descent is therefore a low-k tool on the GPU. Above k of
roughly 30 both exhaustive and IVF beat it, and by k = 200 they beat it by
more than an order of magnitude.