AscendIndexInt8FlatConfig

API Definition

AscendIndexInt8FlatConfig(std::vector<int> devices, int64_t resources = INT8_FLAT_DEFAULT_MEM, uint32_t blockSize = BLOCK_SIZE)

Function

Constructor of AscendIndexInt8FlatConfig, which is used to generate AscendIndexInt8FlatConfig. The processor resources on the NPU and the resource pool size are configured based on the value configured in devices.

Input

std::vector<int> devices: processor resources on the NPU.

int64_t resources: 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 base library capacity and the number of search batches. If the base library has 10 million records or more and the number of the batches 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 storage vector after the base library sharding. The default value of BLOCK_SIZE is 262144 (16384 x 16).

Output

N/A

Return Value

N/A

Restrictions

  • The devices must be a valid processor ID. A maximum of 64 processors are supported.
  • The value of resources cannot exceed 1024 MB (1024 x 1024 x 1024 bytes). When resources is set to -1, the value of the configured processor resources on the NPU is 128 MB.
  • The value set of blockSize is {16384, 32768, 65536, 131072, 262144}.