Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

add ivf_flat_cc index #824

Merged
merged 1 commit into from
Apr 21, 2023
Merged

add ivf_flat_cc index #824

merged 1 commit into from
Apr 21, 2023

Conversation

foxspy
Copy link
Collaborator

@foxspy foxspy commented Apr 16, 2023

Issue #823
Add IVF_FLAT_CC to support running build & search on IVF index concurrently by following change

  1. Add IVF_FLAT_CC index inherited with IVF_FLAT
  2. Replace the InvertedLists implementation from ArrayInvertedLists into ConcurrentArrayInvertedLists

@mergify mergify bot added the ci-passed label Apr 19, 2023
@@ -402,6 +406,10 @@ class BaseConfig : public Config {
.description("search for top k similar vector.")
.set_range(1, std::numeric_limits<CFG_INT>::max())
.for_search();
KNOWHERE_CONFIG_DECLARE_FIELD(num_build_thread)
.set_default(-1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

-1 is a valid value ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need a default value to indicate user has not set this value, and '-1' gives this semantic.

@@ -36,6 +36,18 @@ class IvfConfig : public BaseConfig {

class IvfFlatConfig : public IvfConfig {};

class IvfFlatCcConfig : public IvfFlatConfig {
public:
int ssize;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's better to name it to "segment_size"

include/knowhere/config.h Outdated Show resolved Hide resolved
@@ -92,6 +92,28 @@ const uint8_t* InvertedLists::get_single_code(size_t list_no, size_t offset)
return get_codes(list_no) + offset * code_size;
}

size_t InvertedLists::get_segment_num(size_t list_no) const {
Copy link
Member

Choose a reason for hiding this comment

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

let's inline these functions

Copy link
Collaborator Author

@foxspy foxspy Apr 21, 2023

Choose a reason for hiding this comment

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

It seems that inline virtual function is legal but gain no benefit in our case, since the function call use polymorphism mechanism determined at runtime but inline sign processed at compiler time. I find some material to support the viewpoint: https://www.geeksforgeeks.org/inline-virtual-function/

Copy link
Member

@liliu-z liliu-z left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@sre-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: foxspy, liliu-z

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

Signed-off-by: xianliang <xianliang.li@zilliz.com>
@sre-ci-robot sre-ci-robot removed the lgtm label Apr 21, 2023
@mergify mergify bot added ci-passed and removed ci-passed labels Apr 21, 2023
@liliu-z
Copy link
Member

liliu-z commented Apr 21, 2023

/lgtm

@sre-ci-robot sre-ci-robot merged commit 717a7b0 into milvus-io:main Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants