下载
中文
注册

AscendIndexVstarInitParams

API定义

AscendIndexVstarInitParams(int dim, int subSpaceDim, int nlist, const std::vector<int>& deviceList, bool verbose = false, int64_t resourceSize = VSTAR_DEFAULT_MEM);

功能描述

vstar模式初始化参数结构体。

输入

int dim:特征向量的维度。

int subSpaceDim:第一次降维后的维度大小。

int nlist:一级聚类的数量。

const std::vector<int>& deviceList:指定的NPU physical ID。

bool verbose:指定是否开启verbose选项,开启后部分操作提供额外的打印提示。默认值“false“。

int64_t resourceSize:设备侧预置的内存池大小,单位为Byte,计算过程中存储中间结果的内存空间,用于避免计算过程中动态申请内存造成性能波动。默认参数为头文件中定位的“VSTAR_DEFAULT_MEM”,大小为128M。该参数通过底库大小和search的batch数共同确定。

输出

参数约束

dim ∈ {128,256,512,1024},默认值为“1024”

subSpaceDim ∈ {32,64,128}。subSpaceDim 必须小于dim。默认值“128“。

nlist∈ {256,512,1024}。默认值“1024“。

deviceList:请使用npu-smi命令查询对应的NPU卡physical ID,仅支持一个device设备ID。

resourceSize ∈ [128M, 2048M]。