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]:[new_indexes] Create index hangs if there is no required parameter "nrq" for new HNSW PRQ index #36922

Closed
1 task done
binbinlv opened this issue Oct 16, 2024 · 7 comments
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 Oct 16, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

Create index hangs if there is no required parameter "nrq" for new HNSW PRQ index

Expected Behavior

no hangs, and report error

Steps To Reproduce

from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
import json


connections.connect()

dim = 128
int64_field = FieldSchema(name="int64", dtype=DataType.INT64, is_primary=True)
float_field = FieldSchema(name="float", dtype=DataType.FLOAT)
bool_field = FieldSchema(name="bool", dtype=DataType.BOOL)
string_field = FieldSchema(name="string", dtype=DataType.VARCHAR, max_length=65535)
json_field = FieldSchema(name="json_field", dtype=DataType.JSON)
float_vector = FieldSchema(name="float_vector", dtype=DataType.FLOAT_VECTOR, dim=dim)

schema = CollectionSchema(fields=[int64_field, float_field, bool_field, float_vector])

collection = Collection("test_search_collection_binbin_tmp_0", schema=schema)

metric = "IP"
import random
default_search_params = {"metric_type": metric, "params": {"nprobe": 10}}

nb=10000

vectors = [[random.random() for _ in range(dim)] for _ in range(nb)]
import numpy as np
res = collection.insert([[i for i in range(nb)], [np.float32(i) for i in range(nb)], [np.bool_(i) for i in range(nb)], vectors])
collection.flush()
print(collection.num_entities)
index = {"index_type": "FAISS_HNSW_PRQ", "metric_type": metric, "params": {}}
print("creating index")
collection.create_index("float_vector", index, index_name="index_name_1")
print("created index")

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 Oct 16, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Oct 16, 2024
@binbinlv
Copy link
Contributor Author

/unassign @yanliang567

@binbinlv binbinlv changed the title [Bug]: Create index hangs if there is no required parameter "nrq" for new HNSW PRQ index [Bug]:[new_indexes] Create index hangs if there is no required parameter "nrq" for new HNSW PRQ index Oct 16, 2024
@alexanderguzhva
Copy link
Contributor

/assign @alexanderguzhva

@binbinlv
Copy link
Contributor Author

binbinlv commented Nov 1, 2024

/assign @binbinlv
working on verification.

@binbinlv
Copy link
Contributor Author

binbinlv commented Nov 1, 2024

Verified and fixed in 2.5 branch:

milvus: 2.5-20241101-116bf501-amd64

results:

>>> collection.create_index("float_vector", index, index_name="index_name_1")
RPC error: [create_index], <MilvusException: (code=1100, message=param 'nrq' not exist in json: invalid parameter[expected=valid index params][actual=invalid index params])>, <Time:{'RPC start': '2024-11-02 01:25:26.277278', 'RPC error': '2024-11-02 01:25:26.301952'}>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/orm/collection.py", line 1373, in create_index
    return conn.create_index(self._name, field_name, index_params, timeout=timeout, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 141, in handler
    raise e from e
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 137, in handler
    return func(*args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 176, in handler
    return func(self, *args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 116, in handler
    raise e from e
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 86, in handler
    return func(*args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/client/grpc_handler.py", line 992, in create_index
    check_status(status)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/client/utils.py", line 63, in check_status
    raise MilvusException(status.code, status.reason, status.error_code)
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=param 'nrq' not exist in json: invalid parameter[expected=valid index params][actual=invalid index params])>

@binbinlv
Copy link
Contributor Author

binbinlv commented Nov 1, 2024

But when verify this issue on master latest, it create the "FAISS_HNSW_PRQ" index successfully without required parameter "nrq"

pymilvus: 2.5.0rc106
milvus: master-20241101-0ac8b166

results:

>>> index = {"index_type": "FAISS_HNSW_PRQ", "metric_type": metric, "params": {}}
>>> print("creating index")
creating index
>>> collection.create_index("float_vector", index, index_name="index_name_1")
Status(code=0, message=)
>>>

@foxspy
Copy link
Contributor

foxspy commented Nov 4, 2024

But when verify this issue on master latest, it create the "FAISS_HNSW_PRQ" index successfully without required parameter "nrq"

pymilvus: 2.5.0rc106 milvus: master-20241101-0ac8b166

results:

>>> index = {"index_type": "FAISS_HNSW_PRQ", "metric_type": metric, "params": {}}
>>> print("creating index")
creating index
>>> collection.create_index("float_vector", index, index_name="index_name_1")
Status(code=0, message=)
>>>

@binbinlv The master branch is as expected, with a default value for nrq. Please retry on the 2.5 branch after updating it to the same version of knowhere.

@binbinlv
Copy link
Contributor Author

binbinlv commented Nov 4, 2024

OK, the 2.5 branch is deleted and master branch has been verified as the new design, so close this issue.

@binbinlv binbinlv closed this as completed Nov 4, 2024
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

5 participants