Skip to content

Conversation

alexanderguzhva
Copy link
Collaborator

/kind improvement
issue: #1290

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexanderguzhva

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@alexanderguzhva
Copy link
Collaborator Author

@sparknack Hi, could you please confirm that the logic is valid for sparse vectors? Thanks.

@mergify mergify bot added the ci-passed label Aug 7, 2025
if ((dim != Dim()) && (IsMetricType(metric_str, metric::COSINE) || IsMetricType(metric_str, metric::IP) ||
IsMetricType(metric_str, metric::L2))) {
const std::string msg_e =
fmt::format("dimensionalities of the base dataset ({}) and the query ({}) do not match", Dim(), dim);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put these repeated codes into a util function

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, this should have already been intercepted in Milvus. What issue are you encountering here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a problem in KIOXIA unit test that triggered a problem

@@ -119,6 +119,17 @@ BruteForce::Search(const DataSetPtr base_dataset, const DataSetPtr query_dataset
auto labels = std::make_unique<int64_t[]>(nq * topk);
auto distances = std::make_unique<float[]>(nq * topk);

const std::string metric_str = cfg.metric_type.value();
if ((base_dataset->GetDim() != query_dataset->GetDim()) &&
(IsMetricType(metric_str, metric::COSINE) || IsMetricType(metric_str, metric::IP) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IP metrics could also work with sparse vectors.
Can we skip all the query dimension checks by identifying whether the base_dataset and query_dataset are sparse?

@github-actions github-actions bot added the stale label Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants