Function Description

It is a huawei-developed vector retrieval algorithm that provides approximate retrieval capabilities of a high-dimensional large base library on Ascend and Kunpeng. This strategy can retrieve the topK most approximate vector results in a base library.

The vectors stored in a base library and the query vectors of each API must be of the normalized float type.

Multi-thread concurrent calling is not supported. Therefore, you need to add locks in multi-thread scenarios. Otherwise, the retrieval API may be abnormal. In addition, one device cannot be shared by different threads.

This algorithm is primarily used for approximate fuzzy search in large-scale base libraries. Compared with brute-force search, its precision is reduced. In the small base library scenario, you are advised to increase the hyperparameter value to minimize precision loss.

  • For params passed during index instance creation, set dim based on the actual situation.
  • There are two index modes: KMode and AKMode. In KMode, only Kunpeng algorithms can be used. In AKMode, both Kunpeng and Ascend algorithms can be used, but corresponding operators need to be generated in advance.
  • The value of subSpaceDimnlist must be the same as that of the corresponding parameter during codebook training.