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] The default value of index parameters are not showed in "collection.index().params" for new HNSW SQ/PQ/PRQ indexes if not specifying the index params #36926

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

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

The default value of index parameters is not shown in "collection.index().params" for new HNSW SQ/PQ/PRQ indexes

collection.index().params:
{'index_type': 'FAISS_HNSW_SQ', 'metric_type': 'IP', 'params': {}}

Expected Behavior

show the default value of index parameters in somewhere user could get it.

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_SQ", "metric_type": metric, "params": {}}
print("creating index")
collection.create_index("float_vector", index, index_name="index_name_1")
print("created index")
params = collection.index().params
print(params)

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 16, 2024
@binbinlv binbinlv changed the title [Bug]: The default value of index parameters are not showed in "collection.index().params" for new HNSW SQ/PQ/PRQ indexes if not specifying the index params [Bug]: [new_indexes] The default value of index parameters are not showed in "collection.index().params" for new HNSW SQ/PQ/PRQ indexes if not specifying the index params Oct 16, 2024
@binbinlv binbinlv added the kind/enhancement Issues or changes related to enhancement label Oct 16, 2024
@alexanderguzhva
Copy link
Contributor

/assign @alexanderguzhva

@yanliang567
Copy link
Contributor

I think this is the current behavior for the other index types. need to further discussion about if we need a new design/

@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 17, 2024
@yanliang567 yanliang567 removed their assignment Oct 17, 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 kind/enhancement Issues or changes related to enhancement triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants