Skip to main content

cuvsCagraSearchParams

Struct cuvsCagraSearchParams 

Source
#[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: usize

Maximum number of queries to search at the same time (batch size). Auto select when 0.

§itopk_size: usize

Number 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: usize

Upper limit of search iterations. Auto select when 0.

§algo: cuvsCagraSearchAlgo

Which search implementation to use.

§team_size: usize

Number of threads used to calculate a single distance. 4, 8, 16, or 32.

§search_width: usize

Number of graph nodes to select as the starting point for the search in each iteration. aka search width?

§min_iterations: usize

Lower limit of search iterations.

§thread_block_size: usize

Thread block size. 0, 64, 128, 256, 512, 1024. Auto selection when 0.

§hashmap_mode: cuvsCagraHashMode

Hashmap type. Auto selection when AUTO.

§hashmap_min_bitlen: usize

Lower limit of hashmap bit length. More than 8.

§hashmap_max_fill_rate: f32

Upper limit of hashmap fill rate. More than 0.1, less than 0.9.

§num_random_samplings: u32

Number of iterations of initial random seed node selection. 1 or more.

§rand_xor_mask: u64

Bit mask used for initial random seed node selection.

§persistent: bool

Whether to use the persistent version of the kernel (only SINGLE_CTA is supported a.t.m.)

§persistent_lifetime: f32

Persistent kernel: time in seconds before the kernel stops if no requests received.

§persistent_device_usage: f32

Set 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

Source§

fn clone(&self) -> cuvsCagraSearchParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for cuvsCagraSearchParams

Source§

impl Debug for cuvsCagraSearchParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.