Skip to content

Commit

Permalink
Add test cases of output vector (milvus-io#27215)
Browse files Browse the repository at this point in the history
Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 authored Sep 21, 2023
1 parent 217ed38 commit 206cc14
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 154 deletions.
10 changes: 10 additions & 0 deletions tests/python_client/common/common_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ def gen_invalid_search_params_type():
continue
annoy_search_param = {"index_type": index_type, "search_params": {"search_k": search_k}}
search_params.append(annoy_search_param)
elif index_type == "SCANN":
for reorder_k in ct.get_invalid_ints:
if isinstance(reorder_k, int):
continue
scann_search_param = {"index_type": index_type, "search_params": {"nprobe": 8, "reorder_k": reorder_k}}
search_params.append(scann_search_param)
elif index_type == "DISKANN":
for search_list in ct.get_invalid_ints:
diskann_search_param = {"index_type": index_type, "search_params": {"search_list": search_list}}
Expand Down Expand Up @@ -883,6 +889,10 @@ def gen_search_param(index_type, metric_type="L2"):
for search_k in [1000, 5000]:
annoy_search_param = {"metric_type": metric_type, "params": {"search_k": search_k}}
search_params.append(annoy_search_param)
elif index_type == "SCANN":
for reorder_k in [1200, 3000]:
scann_search_param = {"metric_type": metric_type, "params": {"nprobe": 64, "reorder_k": reorder_k}}
search_params.append(scann_search_param)
elif index_type == "DISKANN":
for search_list in [20, 300, 1500]:
diskann_search_param = {"metric_type": metric_type, "params": {"search_list": search_list}}
Expand Down
4 changes: 2 additions & 2 deletions tests/python_client/common/common_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@
]

""" Specially defined list """
all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "DISKANN", "BIN_FLAT", "BIN_IVF_FLAT",
all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "SCANN", "DISKANN", "BIN_FLAT", "BIN_IVF_FLAT",
"GPU_IVF_FLAT", "GPU_IVF_PQ"]

default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500}, {}, {"nlist": 128}, {"nlist": 128},
{"M": 48, "efConstruction": 500}, {"nlist": 128}, {}, {"nlist": 128}, {"nlist": 128},
{"nlist": 64}, {"nlist": 64, "m": 16, "nbits": 8}]

Handler_type = ["GRPC", "HTTP"]
Expand Down
Loading

0 comments on commit 206cc14

Please sign in to comment.