
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", "cagra"). 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. CAGRA only. Node degree of the graph after pruning.NULLgives 30. Defaults toNULL.k_build - Integer or
NULL. NN-descent and CAGRA. Working degree of the descent.NULLgivesmax(k, floor(1.5 * k)). Defaults toNULL.n_tree - Integer or
NULL. NN-descent and CAGRA. Trees seeding the descent. Defaults toNULL.delta - Numeric. NN-descent and CAGRA. Termination criterium for the descent. Defaults to
0.001.rho - Numeric or
NULL. NN-descent and CAGRA. Sampling rate for the descent. Defaults toNULL.refine_knn - Integer or
NULL. NN-descent and CAGRA. 2-hop refinement sweeps after the descent. Buys graph quality at a linear cost.NULLgives 0. Defaults toNULL.beam_width - Integer or
NULL. CAGRA only, which includes NN-descent on a cross-query. Beam width when querying. Defaults toNULL.max_beam_iters - Integer or
NULL. CAGRA only, which includes NN-descent on a cross-query. Beam search iterations. Defaults toNULL.n_entry_points - Integer or
NULL. CAGRA only, which includes NN-descent on a cross-query. Entry points when querying. Defaults toNULL.
Details
"nndescent" hands back the kNN graph the descent built, with no index and
no search; rows the descent left short are topped up with an exact search of
just those rows. Where the query is a different set of cells (BBKNN, fastMNN)
it builds and beam searches a CAGRA graph instead. "cagra" always does the
latter, self-queries included. The descent itself dominates either way, and
its build degree tracks k, so both are low-k tools on the GPU. Above k
of roughly 30 exhaustive and IVF beat them.