milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
351 stars 110 forks source link

[Bug]: NewIndexIvfFlat(entity.COSINE, 1024), Error: metric type not found or not supported #836

Closed iotwq closed 1 month ago

iotwq commented 1 month ago

Is there an existing issue for this?

Current Behavior

idx, err := entity.NewIndexGPUIvfFlat(entity.COSINE, 1024)
if err != nil {
    return fmt.Errorf("failed to create index, err: %v", err)
}

Hello, I want to use gpu to accelerate milvus query speed, and then use the above code to insert the GPU_IVF_FLAT index type, but MetricType is COSINE, it triggered the following error; What should I do if I just want to use COSINE now, which other index type can I use to use gpu acceleration?

metric type not found or not supported, supported: [L2 IP]: invalid parameter[expected=valid index params][actual=invalid index params]

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

congqixia commented 1 month ago

Hi @iotwq Thanks for the feedback. Currently the index engine of Milvus does not support COSINE metrics type for gpu indexes. Just confirmed with the engine team that they get the plan to support that in next few releases. The current workaround is to use IP metrics type with normalization. But the performance may be impacted since IP got lots fallback logic in some corner cases

iotwq commented 1 month ago

Thank you very much and look forward to your new version.