Skip to content

Comments

Add iterator support to brute force search#369

Merged
sre-ci-robot merged 4 commits intozilliztech:mainfrom
zhengbuqian:iterator-brute-force
Feb 2, 2024
Merged

Add iterator support to brute force search#369
sre-ci-robot merged 4 commits intozilliztech:mainfrom
zhengbuqian:iterator-brute-force

Conversation

@zhengbuqian
Copy link
Collaborator

@zhengbuqian zhengbuqian commented Feb 1, 2024

issue: #367
added unit test for fp32 type

milvus-io/milvus#30307

/kind enhancement

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zhengbuqian

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

The pull request process is described here

Details 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

@mergify
Copy link

mergify bot commented Feb 1, 2024

@zhengbuqian 🔍 Important: PR Classification Needed!

For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:

  1. If you're fixing a bug, label it as kind/bug.
  2. For small tweaks (less than 20 lines without altering any functionality), please use kind/improvement.
  3. Significant changes that don't modify existing functionalities should be tagged as kind/enhancement.
  4. Adjusting APIs or changing functionality? Go with kind/feature.

For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”.

Thanks for your efforts and contribution to the community!.

@mergify mergify bot added the ci-passed label Feb 1, 2024
Copy link
Collaborator

@alexanderguzhva alexanderguzhva left a comment

Choose a reason for hiding this comment

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

nits

}
size_t current_end = std::min(results_.size(), sorted_ + sort_size_);
std::nth_element(results_.begin() + sorted_, results_.begin() + current_end, results_.end(), comp_);
std::sort(results_.begin() + sorted_, results_.begin() + current_end, comp_);
Copy link
Collaborator

Choose a reason for hiding this comment

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

std::partial_sort()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

std::vector<std::pair<float, int64_t>> results_;
size_t next_ = 0;
size_t sorted_ = 0;
size_t sort_size_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

size_t sort_size_ = 0;

@alexanderguzhva
Copy link
Collaborator

/lgtm
overall

…types

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
@sre-ci-robot sre-ci-robot removed the lgtm label Feb 2, 2024
@mergify mergify bot removed the ci-passed label Feb 2, 2024
Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
@cydrain
Copy link
Contributor

cydrain commented Feb 2, 2024

/lgtm

@zhengbuqian
Copy link
Collaborator Author

issue: #367

both this and IVFFLAT iterators are for growing segment, using that as the umbrella issue

@sre-ci-robot sre-ci-robot merged commit d36842e into zilliztech:main Feb 2, 2024
@zhengbuqian zhengbuqian deleted the iterator-brute-force branch February 2, 2024 07:31
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