AscendIndexVstarInitParams
API definition |
AscendIndexVstarInitParams(); |
|---|---|
Function |
Data structure of the initialization parameter in Vstar mode. |
Input |
N/A |
Output |
N/A |
Restrictions |
For details, see AscendIndexVstarHyperParams. |
API definition |
AscendIndexVstarInitParams(int dim, int subSpaceDim, int nlist, const std::vector<int>& deviceList, bool verbose = false, int64_t resourceSize = VSTAR_DEFAULT_MEM); |
|---|---|
Function |
Data structure of the initialization parameter in Vstar mode. |
Input |
int dim: dimension of the feature vector. int subSpaceDim: dimension size after dimension reduction for the first time. int nlist: number of level-1 clusters. const std::vector<int>& deviceList: physical ID of the NPU. bool verbose: whether to enable verbose. If it is enabled, additional information will be displayed for some operations. The default value is false. int64_t resourceSize: preset memory pool size on the device, in bytes. It is the memory space for storing intermediate results during computing to prevent performance fluctuation caused by dynamic memory allocation. The default parameter is VSTAR_DEFAULT_MEM defined in the header file, and the size is 128 MB. The value is determined by the database capacity and search batch size. |
Output |
N/A |
Restrictions |
dim ∈ {128, 256, 512, 1024}. The default value is 1024. subSpaceDim ∈ {32, 64, 128}. The value of subSpaceDim must be less than that of dim. The default value is 128. nlist ∈ {256, 512, 1024}. The default value is 1024. deviceList: Run the npu-smi command to query the physical ID of the NPU. Only one device ID is supported. resourceSize ∈ [128M, 2048M] |