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

Add index feature manager & static config check #796

Closed
wants to merge 1 commit into from

Conversation

foxspy
Copy link
Collaborator

@foxspy foxspy commented Aug 28, 2024

issue: #795

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: foxspy

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

@foxspy
Copy link
Collaborator Author

foxspy commented Aug 28, 2024

/hold

Copy link

mergify bot commented Aug 28, 2024

@foxspy 🔍 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!.

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.64%. Comparing base (3c46f4c) to head (9e1257e).
Report is 218 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main     #796       +/-   ##
=========================================
+ Coverage      0   79.64%   +79.64%     
=========================================
  Files         0       80       +80     
  Lines         0     6259     +6259     
=========================================
+ Hits          0     4985     +4985     
- Misses        0     1274     +1274     

see 80 files with indirect coverage changes

// This flag indicates that there is no need to create any index structure (build stage can be skipped)
constexpr uint64_t BF = 1UL << 16;
// This flag indicates that the index defaults to KNN search, meaning the recall rate is 100%
constexpr uint64_t KNN = 1UL << 17;
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comment is confusing. Bruteforce with fp16 does not have a 100% recall rate.
I'd use the This flag indicates that the index defaults to brute force search, meaning that the recall rate is maximum possible for the given data precision

// This flag indicates that the index defaults to KNN search, meaning the recall rate is 100%
constexpr uint64_t KNN = 1UL << 17;
// This flag indicates that the index is deployed on GPU (need GPU devices)
constexpr uint64_t GPU = 1UL << 18;
Copy link
Collaborator

Choose a reason for hiding this comment

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

training or search? or both?

constexpr uint64_t KNN = 1UL << 17;
// This flag indicates that the index is deployed on GPU (need GPU devices)
constexpr uint64_t GPU = 1UL << 18;
// This flag indicates that the index support using mmap manage its mainly memory, which can significant improve the
Copy link
Collaborator

Choose a reason for hiding this comment

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

supports

// This flag indicates that the index support using mmap manage its mainly memory, which can significant improve the
// capacity
constexpr uint64_t MMAP = 1UL << 19;
// This flag indicates that the index support using materialized view to accelerate filtering search
Copy link
Collaborator

Choose a reason for hiding this comment

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

supports

constexpr uint64_t MMAP = 1UL << 19;
// This flag indicates that the index support using materialized view to accelerate filtering search
constexpr uint64_t MV = 1UL << 20;
// This flag indicates that the index need disk during search
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comment is unclear

#define FEATURE_H

// these features have been report to outside (milvus); pls sync the feature code when it needs to be changed.
namespace knowhere::feature {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why uint64_t instead of a formal struct Features {};, which can be extendable and more appropriate for further changes and more clear code?

IndexFactory::GlobalIndexTable&
IndexFactory::StaticIndexTableInstance() {
static GlobalIndexTable static_index_table;
return static_index_table;
}

bool
IndexFactory::FeatureCheck(const std::string& name, uint64_t feature) const {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe, return std::optional<bool>, which returns nullopt if name is not known?

@foxspy foxspy force-pushed the add_vector_index_mgr branch 2 times, most recently from 8a599a6 to 6b011e1 Compare August 29, 2024 08:19
@mergify mergify bot added the ci-passed label Aug 29, 2024
@mergify mergify bot removed the ci-passed label Sep 4, 2024
@alexanderguzhva
Copy link
Collaborator

@foxspy is it good to review this PR?

@foxspy foxspy force-pushed the add_vector_index_mgr branch 2 times, most recently from cfd1285 to 3322656 Compare September 11, 2024 06:52
@foxspy foxspy force-pushed the add_vector_index_mgr branch 5 times, most recently from a619291 to 75caa52 Compare October 10, 2024 13:54
@foxspy
Copy link
Collaborator Author

foxspy commented Oct 10, 2024

/hold
wait all tests (include milvus) pass

@foxspy
Copy link
Collaborator Author

foxspy commented Oct 10, 2024

@foxspy is it good to review this PR?

Thanks, please help with the review. The code won’t change much, but this commit contains a lot of mixed content. I plan to break it into several commits.

@foxspy foxspy force-pushed the add_vector_index_mgr branch 2 times, most recently from dd8e57a to 4f23127 Compare October 11, 2024 03:00
@mergify mergify bot added the ci-passed label Oct 11, 2024
@mergify mergify bot removed the ci-passed label Oct 11, 2024
@foxspy foxspy force-pushed the add_vector_index_mgr branch 2 times, most recently from afb84da to 0f281f7 Compare October 12, 2024 06:28
@foxspy
Copy link
Collaborator Author

foxspy commented Oct 14, 2024

split this pr into #887 and #888

@foxspy foxspy closed this Oct 14, 2024
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.

3 participants