CAGRA配置

本文介绍CAGRA算法Build参数与Search参数配置。

CAGRA索引build参数

参数值

类型

默认值

说明

proxima.cagra.index.graph_degree

int

64

查询阶段近邻图中节点的邻边数量,越大则召回率越好,但性能会相应下降。

proxima.cagra.index.intermediate_graph_degree

int

128

建图阶段构建的近邻图中节点的邻边数量,查询阶段会被裁剪至 proxima.cagra.index.graph_degree,值不小于 proxima.cagra.index.graph_degree,一般不大于1.5倍 proxima.cagra.index.graph_degree。

proxima.cagra.index.mode.fp16

int

0

是否打开fp16量化,建议设置为1(打开),基本不影响召回率。

CAGRA索引search参数

参数值

类型

默认值

说明

proxima.cagra.search.use_batchable_searcher

int

0

相较于逐个执行用户发送的查询请求,将这些请求打包为一批执行通常能获得更高的执行效率。将此选项设置为1(打开)时,系统将自动将短时间内同时到达的请求合并为一批执行,从而提升性能。

proxima.cagra.search.use_gpu_built_index

int

0

是否使用来自CPU构建的图,目前仅支持设置为0(是)。

proxima.cagra.search.itopk_size

int

64

与算法迭代时的候选集大小相关,需要为32的倍数,必须大于等于需要的topK值(若需返回top100,则该值必须大于等于100)。越大则召回率越好,但性能会相应下降。