Rate This Document
Findability
Accuracy
Completeness
Readability

Installation and Usage Description

The KBest optimization feature for the Milvus database is provided in the form of a patch file. Before using this optimization feature, install the Kunpeng Recall Algorithm Library to ensure that the patch file can be compiled properly.

The open source Milvus source code does not include the index-related component Knowhere, which requires to pull the Knowhere source code during Milvus compilation and integrate it into the database. This feature is mainly used to optimize the index query and its patch file is added to the Knowhere source code. Therefore, Milvus needs to be compiled twice. The first compilation is to obtain the Knowhere source code. After the patch file is loaded into Knowhere, the second compilation is performed to enable the optimization feature.

  1. Download the Kunpeng Retrieval Algorithm Library to the home directory ~, decompress the package, and install it.

    See Table 2 for details about how to obtain KBest.

    1
    2
    3
    cd ~
    unzip BoostKit-SRA_Recall-1.2.0.zip
    rpm -ivh boostkit-sra_recall-1.2.0-1.aarch64.rpm
    
  2. Use Git to clone Milvus, select version 2.4.5, and place it in the home directory ~.

    See Table 2 for details about how to obtain Milvus, and follow instructions in Milvus Installation Guide to compile and install Milvus.

  3. Obtain the optimization feature patch file and upload it to the home directory ~.

    For details, see Table 2.

  4. Integrate the optimization feature. If no command output is displayed, the integration is successful.
    1
    2
    3
    4
    cd ~/milvus
    git apply --whitespace=nowarn < ~/0001-milvus-add-kbest-kscann.patch
    cd ~/milvus/cmake_build/thirdparty/knowhere/knowhere-src/
    git apply --whitespace=nowarn < ~/0001-knowhere-add-kbest-kscann.patch
    
  5. Go back to the installation directory and perform full compilation on Milvus again to enable the optimization feature.
    1
    2
    cd ~/milvus
    make milvus
    
  6. Use the ANN-Benchmarks GIST dataset for tests and obtain the performance improvement before and after the optimization feature is enabled, as shown in Figure 1. For details about the test procedure, see Milvus ANN-Benchmarks Test Guide.
    Figure 1 Performance comparison before and after optimization