Loading tests/milvus_ann_acc/client.py +4 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,10 @@ class MilvusClient(object): index_type = IndexType.IVF_SQ8 elif index_type == "ivf_sq8h": index_type = IndexType.IVF_SQ8H elif index_type == "mix_nsg": index_type = IndexType.MIX_NSG elif index_type == "nsg": index_type = IndexType.NSG elif index_type == "ivf_pq": index_type = IndexType.IVF_PQ index_params = { "index_type": index_type, "nlist": nlist, Loading tests/milvus_ann_acc/requirements.txt +3 −3 Original line number Diff line number Diff line numpy==1.16.3 pymilvus>=0.2.0 pymilvus-test>=0.2.0 scikit-learn==0.19.1 h5py==2.7.1 influxdb==5.2.2 pyyaml==3.12 pyyaml>=5.1 tableprint==0.8.0 ansicolors==1.1.8 scipy==1.3.1 tests/milvus_ann_acc/runner.py +3 −3 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ def recall_calc(result_ids, true_ids, top_k, recall_k): sum_intersect_num = 0 recall = 0.0 for index, result_item in enumerate(result_ids): if len(set(true_ids[index][:top_k])) != len(set(result_item)): logger.warning("Error happened: query result length is wrong") continue # if len(set(true_ids[index][:top_k])) != len(set(result_item)): # logger.warning("Error happened: query result length is wrong") # continue tmp = set(true_ids[index][:recall_k]).intersection(set(result_item)) sum_intersect_num = sum_intersect_num + len(tmp) recall = round(sum_intersect_num / (len(result_ids) * recall_k), 4) Loading tests/milvus_ann_acc/suite.yaml +7 −7 Original line number Diff line number Diff line datasets: - sift-128-euclidean: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-25-angular: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-200-angular: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] hdf5_path: /test/milvus/ann_hdf5/ tests/milvus_ann_acc/suite_cpu.yaml 0 → 100644 +19 −0 Original line number Diff line number Diff line datasets: - sift-128-euclidean: index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-200-angular: index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] hdf5_path: /test/milvus/ann_hdf5/ Loading
tests/milvus_ann_acc/client.py +4 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,10 @@ class MilvusClient(object): index_type = IndexType.IVF_SQ8 elif index_type == "ivf_sq8h": index_type = IndexType.IVF_SQ8H elif index_type == "mix_nsg": index_type = IndexType.MIX_NSG elif index_type == "nsg": index_type = IndexType.NSG elif index_type == "ivf_pq": index_type = IndexType.IVF_PQ index_params = { "index_type": index_type, "nlist": nlist, Loading
tests/milvus_ann_acc/requirements.txt +3 −3 Original line number Diff line number Diff line numpy==1.16.3 pymilvus>=0.2.0 pymilvus-test>=0.2.0 scikit-learn==0.19.1 h5py==2.7.1 influxdb==5.2.2 pyyaml==3.12 pyyaml>=5.1 tableprint==0.8.0 ansicolors==1.1.8 scipy==1.3.1
tests/milvus_ann_acc/runner.py +3 −3 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ def recall_calc(result_ids, true_ids, top_k, recall_k): sum_intersect_num = 0 recall = 0.0 for index, result_item in enumerate(result_ids): if len(set(true_ids[index][:top_k])) != len(set(result_item)): logger.warning("Error happened: query result length is wrong") continue # if len(set(true_ids[index][:top_k])) != len(set(result_item)): # logger.warning("Error happened: query result length is wrong") # continue tmp = set(true_ids[index][:recall_k]).intersection(set(result_item)) sum_intersect_num = sum_intersect_num + len(tmp) recall = round(sum_intersect_num / (len(result_ids) * recall_k), 4) Loading
tests/milvus_ann_acc/suite.yaml +7 −7 Original line number Diff line number Diff line datasets: - sift-128-euclidean: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-25-angular: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-200-angular: index_file_sizes: [50, 1024] index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8', 'ivf_sq8h'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 32, 128, 256] nprobes: [1, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] hdf5_path: /test/milvus/ann_hdf5/
tests/milvus_ann_acc/suite_cpu.yaml 0 → 100644 +19 −0 Original line number Diff line number Diff line datasets: - sift-128-euclidean: index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] - glove-200-angular: index_file_sizes: [1024] index_types: ['ivf_flat', 'ivf_sq8'] # index_types: ['ivf_sq8'] nlists: [16384] search_param: nprobes: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] top_ks: [10] nqs: [10000] hdf5_path: /test/milvus/ann_hdf5/