#[repr(C)]pub struct cuvsCagraSearchParams {Show 16 fields
pub max_queries: usize,
pub itopk_size: usize,
pub max_iterations: usize,
pub algo: cuvsCagraSearchAlgo,
pub team_size: usize,
pub search_width: usize,
pub min_iterations: usize,
pub thread_block_size: usize,
pub hashmap_mode: cuvsCagraHashMode,
pub hashmap_min_bitlen: usize,
pub hashmap_max_fill_rate: f32,
pub num_random_samplings: u32,
pub rand_xor_mask: u64,
pub persistent: bool,
pub persistent_lifetime: f32,
pub persistent_device_usage: f32,
}Expand description
@brief Supplemental parameters to search CAGRA index
Fields§
§max_queries: usizeMaximum number of queries to search at the same time (batch size). Auto select when 0.
itopk_size: usizeNumber of intermediate search results retained during the search.
This is the main knob to adjust trade off between accuracy and search speed. Higher values improve the search accuracy.
max_iterations: usizeUpper limit of search iterations. Auto select when 0.
algo: cuvsCagraSearchAlgoWhich search implementation to use.
team_size: usizeNumber of threads used to calculate a single distance. 4, 8, 16, or 32.
search_width: usizeNumber of graph nodes to select as the starting point for the search in each iteration. aka search width?
min_iterations: usizeLower limit of search iterations.
thread_block_size: usizeThread block size. 0, 64, 128, 256, 512, 1024. Auto selection when 0.
hashmap_mode: cuvsCagraHashModeHashmap type. Auto selection when AUTO.
hashmap_min_bitlen: usizeLower limit of hashmap bit length. More than 8.
hashmap_max_fill_rate: f32Upper limit of hashmap fill rate. More than 0.1, less than 0.9.
num_random_samplings: u32Number of iterations of initial random seed node selection. 1 or more.
rand_xor_mask: u64Bit mask used for initial random seed node selection.
persistent: boolWhether to use the persistent version of the kernel (only SINGLE_CTA is supported a.t.m.)
persistent_lifetime: f32Persistent kernel: time in seconds before the kernel stops if no requests received.
persistent_device_usage: f32Set the fraction of maximum grid size used by persistent kernel. Value 1.0 means the kernel grid size is maximum possible for the selected device. The value must be greater than 0.0 and not greater than 1.0.
One may need to run other kernels alongside this persistent kernel. This parameter can be used to reduce the grid size of the persistent kernel to leave a few SMs idle. Note: running any other work on GPU alongside with the persistent kernel makes the setup fragile.
- Running another kernel in another thread usually works, but no progress guaranteed
- Any CUDA allocations block the context (this issue may be obscured by using pools)
- Memory copies to not-pinned host memory may block the context
Even when we know there are no other kernels working at the same time, setting kDeviceUsage to 1.0 surprisingly sometimes hurts performance. Proceed with care. If you suspect this is an issue, you can reduce this number to ~0.9 without a significant impact on the throughput.
Trait Implementations§
Source§impl Clone for cuvsCagraSearchParams
impl Clone for cuvsCagraSearchParams
Source§fn clone(&self) -> cuvsCagraSearchParams
fn clone(&self) -> cuvsCagraSearchParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more