Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The error message is not user friendly when specify invalid search parameters #37620

Open
1 task done
binbinlv opened this issue Nov 12, 2024 · 2 comments
Open
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Nov 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: milvus-master latest
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): pymilvus latest
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

The error is not user friendly when specify invalid search parameters

(code=65535, message=fail to search on QueryNode 6: worker(6) query failed: Operator::GetOutput failed for [Operator:, plan node id: 1351] :  => failed to search: config={{"k":10,"metric_type":"L2","refine_k":"invalid","span_id":"543a36b8101dc3ec","trace_flags":0,"trace_id":"493e6082634c3999833e6fbcf0abd5ae"}} invalid value in json: stof at /workspace/source/internal/core/src/index/VectorMemIndex.cpp:411

Expected Behavior

The error message is too code style, not user friendly words

Steps To Reproduce

    @pytest.mark.tags(CaseLabel.L1)
    @pytest.mark.parametrize("index", ct.all_index_types[7:11])
    @pytest.mark.parametrize("refine_type", ["SQ6", "SQ8", "FP16", "BF16", "FP32", "FLAT"])
    def test_search_after_new_hnsw_index_with_invalid_refine_k(self, index, refine_type):
        """
        target: test search new HNSW index with refine
        method: search new HNSW index with refine
        expected: searched successfully
        """
        if index == ct.HNSW_FLAT:
            pytest.skip("HNSW_FLAT index not support refine")
        # 1. initialize with data
        dim = 64
        auto_id = True
        enable_dynamic_field = True
        collection_w, _vectors, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, 3000,
                                                                                         partition_num=1,
                                                                                         auto_id=auto_id,
                                                                                         dim=dim, is_index=False,
                                                                                         enable_dynamic_field=enable_dynamic_field)[0:5]
        # 2. get vectors that inserted into collection
        original_vectors = []
        if enable_dynamic_field:
            for vector in _vectors[0]:
                vector = vector[ct.default_float_vec_field_name]
                original_vectors.append(vector)
        else:
            for _vector in _vectors:
                vectors_tmp = np.array(_vector).tolist()
                vectors_single = [vectors_tmp[i][-1] for i in range(2500)]
                original_vectors.append(vectors_single)
        log.info(len(original_vectors))
        # 3. create different index
        params = cf.get_index_params_params(index)
        if params.get("m"):
            if (dim % params["m"]) != 0:
                params["m"] = dim // 4
        if params.get("PQM"):
            if (dim % params["PQM"]) != 0:
                params["PQM"] = dim // 4
        if index.startswith("FAISS_"):
            params["refine_type"] = refine_type
        log.info("test_search_after_new_hnsw_index_with_invalid_refine_k: Creating index-%s" % index)
        default_index = {"index_type": index, "params": params, "metric_type": "L2"}
        collection_w.create_index("float_vector", default_index)
        log.info("test_search_after_new_hnsw_index_with_invalid_refine_k: Created index-%s" % index)
        collection_w.load()
        # 4. search
        search_params = cf.gen_search_param(index, "L2")
        vectors = [[random.random() for _ in range(dim)] for _ in range(default_nq)]
        for search_param in search_params:
            limit = default_limit
            if index == "HNSW":
                limit = search_param["params"]["ef"]
                if limit > max_limit:
                    limit = default_nb
            if index == "DISKANN":
                limit = search_param["params"]["search_list"]
            if index.startswith("FAISS_"):
                search_param["params"]["refine_k"] = "invalid"
            log.info("Searching with search params: {}".format(search_param))
            collection_w.search(vectors[:default_nq], default_search_field,
                                search_param, limit,
                                default_search_exp)

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Nov 12, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Nov 12, 2024
@binbinlv
Copy link
Contributor Author

/unassign @yanliang567

@binbinlv
Copy link
Contributor Author

related with #37543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants