Configuration Description
When creating a Milvus collection, you need to specify the dimension of vectors. When the test tool reads the dataset, it loads the dimension. Note that the specified index type is case sensitive. Table 1 describes related configurations in the config.yml configuration file of ANN_Benchmarks.
You are advised to check log information after starting Milvus and creating indexes. If Milvus repeatedly prints error information in logs, parameter configurations are incorrect. Locate and rectify the faults based on the error information to ensure that the query can be correctly executed.
KScaNN does not provide public APIs; it is an intrusive modification of the open source ScaNN algorithm with extensions to its open source interfaces. Therefore, no comprehensive parameter restrictions are implemented on the internal APIs of KScaNN. After Milvus is interconnected with KScaNN, the parameters of open source APIs are not restricted. You can make adjustments according to actual requirements to achieve better performance.
Parameter |
Description |
Value Type and Range |
Recommended Value |
Configuration Principle |
|---|---|---|---|---|
index_type |
Index type specified during the test. |
std::string, KSCANN |
KSCANN |
None |
metric_type |
Distance measurement mode specified during the test. |
const char*
|
None |
This parameter is set by the dataset and does not require configuration. |
dim |
Feature dimension. |
Integer |
None |
This parameter is set by the dataset and does not require configuration. |
n_leaves |
Number of leaf nodes. |
Integer |
[2000] |
This parameter affects the graph construction time and final index quality. If the value is too large, the construction time may be too long and the search performance may deteriorate. If the value is too small, the search precision may be affected. |
dims_per_block |
Number of dimensions that form a sub-vector block in the product quantization (PQ) phase during graph construction. |
Integer |
[4] |
The value 4 is recommended. You may adjust the value as required. |
avq_threshold |
AVQ threshold during graph construction. |
Float |
None |
This parameter affects the pruning policy. Generally, the value 0.2 is used for the IP dataset. For the L2 dataset, this parameter is left empty. |
soar_lambda |
Orthogonality configuration. This parameter takes effect only for the IP dataset. |
Float, greater than 0 |
[-1] |
-1 indicates that this parameter is not used. When using the IP dataset, you may adjust the value as required. |
overretrieve_factor |
Used together with soar_lambda to specify the over-retrieval factor. This parameter takes effect only for the IP dataset. |
Float, [1, 2] |
[-1] |
-1 indicates that this parameter is not used. When using the IP dataset, you may adjust the value as required. |
train_thread |
Number of threads during graph construction. |
Integer |
Number of CPU cores |
Set this parameter to the number of CPU cores unless otherwise specified. |
nprobe |
Number of subspaces that a complex query will search within. |
Integer, [1, n_leaves] |
[250] |
You may adjust the value as required. |
reorder |
Number of results saved before reordering. |
Integer, [k, number of records in the database] |
[900] |
k indicates the number of final results returned. You may adjust the value as required. |
adp_threshold |
Adaptive truncation threshold during query. Reserved. |
Float, [0, 0.8] |
[0] |
You may adjust the value as required. |
adp_refined |
Number of subspaces that a simple query will search within. Reserved. |
Integer, [0, nprobe] |
[0] |
The typical value is 0. However, the value range is [1, nprobe] for search and recommendation scenarios. In this document, the value range is [0, nprobe]. You may adjust the value as required. |
num_thread |
Number of threads during query. |
Integer, greater than or equal to 1 |
[1] |
Set it to 1 unless otherwise specified. |
batch_size |
Size of the preferred batch during automatic parallel batching. |
Integer, greater than or equal to 1 |
[1] |
Set it to 1 unless otherwise specified. |