AscendIndexInt8FlatConfig
AscendIndexInt8Flat requires the corresponding AscendIndexInt8FlatConfig to initialize related resources.
Member Description
Member |
Type |
Description |
|---|---|---|
dIndexMode |
Int8IndexMode |
Configures the index int8 retrieval mode. |
dBlockSize |
uint32_t |
Configures the block size on the device. |
API Description
API definition |
AscendIndexInt8FlatConfig(uint32_t blockSize =BLOCK_SIZE, Int8IndexMode indexMode = Int8IndexMode::DEFAULT_MODE); |
|---|---|
Function |
Constructor of AscendIndexInt8FlatConfig, which is used to generate AscendIndexInt8FlatConfig, configure the block size on the device, and set the retrieval mode of int8. |
Input |
uint32_t blockSize: block size on the device, which limits the amount of data calculated by the TIK operator at a time and the size of each vector stored after database sharding. The default value of BLOCK_SIZE is 262144 (16384 × 16). Int8IndexMode indexMode: Index int8 retrieval mode. The default value is DEFAULT_MODE.
|
Output |
N/A |
Return value |
N/A |
Restrictions |
|
API definition |
AscendIndexInt8FlatConfig(std::initializer_list<int> devices, int64_t resourceSize = INT8_FLAT_DEFAULT_MEM, uint32_t blockSize = BLOCK_SIZE, Int8IndexMode indexMode = Int8IndexMode::DEFAULT_MODE); |
|---|---|
Function |
Constructor of AscendIndexInt8FlatConfig, which is used to generate AscendIndexInt8FlatConfig. The Ascend AI Processor resources on the device and the resource pool size are configured based on the value configured in Devices. It is also used to configure the block size on the device and the int8 retrieval mode. |
Input |
std::initializer_list<int> devices: device ID 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 INT8_FLAT_DEFAULT_MEM in the header file. This parameter is determined by the database capacity and search batch size. If the base library has 10 million records or more and the batch size is greater than or equal to 16, set this parameter to 1024 MB. uint32_t blockSize: block size on the device, which limits the amount of data calculated by the TIK operator at a time and the size of each vector stored after database sharding. The default value of BLOCK_SIZE is 262144 (16384 × 16). Int8IndexMode indexMode: Index int8 retrieval mode. The default value is DEFAULT_MODE.
|
Output |
N/A |
Return value |
N/A |
Restrictions |
|
API definition |
AscendIndexInt8FlatConfig(std::vector<int> devices, int64_t resourceSize = INT8_FLAT_DEFAULT_MEM, uint32_t blockSize = BLOCK_SIZE, Int8IndexMode indexMode = Int8IndexMode::DEFAULT_MODE) |
|---|---|
Function |
Constructor of AscendIndexInt8FlatConfig, which is used to generate AscendIndexInt8FlatConfig. The Ascend AI Processor resources on the device and the resource pool size are configured based on the value configured in devices. It is also used to configure the block size on the device and the int8 retrieval mode. |
Input |
std::vector<int> devices: device ID 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 INT8_FLAT_DEFAULT_MEM in the header file. This parameter is determined by the database capacity and search batch size. If the base library has 10 million records or more and the batch size is greater than or equal to 16, set this parameter to 1024 MB. uint32_t blockSize: block size on the device, which limits the amount of data calculated by the TIK operator at a time and the size of each vector stored after database sharding. The default value of BLOCK_SIZE is 262144 (16384 × 16). Int8IndexMode indexMode: Index int8 retrieval mode. The default value is DEFAULT_MODE.
|
Output |
N/A |
Return value |
N/A |
Restrictions |
|