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 new index_type for milvus: ivf_sq8 #277

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vectordb_bench/backend/clients/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class IndexType(str, Enum):
HNSW = "HNSW"
DISKANN = "DISKANN"
IVFFlat = "IVF_FLAT"
IVFSQ8 = "IVF_SQ8"
Flat = "FLAT"
AUTOINDEX = "AUTOINDEX"
ES_HNSW = "hnsw"
Expand Down
19 changes: 19 additions & 0 deletions vectordb_bench/backend/clients/milvus/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ def search_param(self) -> dict:
"metric_type": self.parse_metric(),
"params": {"nprobe": self.nprobe},
}

class IVFSQ8Config(MilvusIndexConfig, DBCaseConfig):
nlist: int
nprobe: int | None = None
index: IndexType = IndexType.IVFSQ8

def index_param(self) -> dict:
return {
"metric_type": self.parse_metric(),
"index_type": self.index.value,
"params": {"nlist": self.nlist},
}

def search_param(self) -> dict:
return {
"metric_type": self.parse_metric(),
"params": {"nprobe": self.nprobe},
}


class FLATConfig(MilvusIndexConfig, DBCaseConfig):
Expand Down Expand Up @@ -210,6 +228,7 @@ def search_param(self) -> dict:
IndexType.HNSW: HNSWConfig,
IndexType.DISKANN: DISKANNConfig,
IndexType.IVFFlat: IVFFlatConfig,
IndexType.IVFSQ8: IVFSQ8Config,
IndexType.Flat: FLATConfig,
IndexType.GPU_IVF_FLAT: GPUIVFFlatConfig,
IndexType.GPU_IVF_PQ: GPUIVFPQConfig,
Expand Down
3 changes: 3 additions & 0 deletions vectordb_bench/frontend/const/dbCaseConfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CaseConfigInput(BaseModel):
"options": [
IndexType.HNSW.value,
IndexType.IVFFlat.value,
IndexType.IVFSQ8.value,
IndexType.DISKANN.value,
IndexType.Flat.value,
IndexType.AUTOINDEX.value,
Expand Down Expand Up @@ -197,6 +198,7 @@ class CaseConfigInput(BaseModel):
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [
IndexType.IVFFlat.value,
IndexType.IVFSQ8.value,
IndexType.GPU_IVF_FLAT.value,
IndexType.GPU_IVF_PQ.value,
],
Expand All @@ -213,6 +215,7 @@ class CaseConfigInput(BaseModel):
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [
IndexType.IVFFlat.value,
IndexType.IVFSQ8.value,
IndexType.GPU_IVF_FLAT.value,
IndexType.GPU_IVF_PQ.value,
],
Expand Down