Skip to content
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 @@ -22,6 +22,7 @@ class IndexType(str, Enum):
DISKANN = "DISKANN"
STREAMING_DISKANN = "DISKANN"
IVFFlat = "IVF_FLAT"
IVFPQ = "IVF_PQ"
IVFSQ8 = "IVF_SQ8"
IVF_RABITQ = "IVF_RABITQ"
Flat = "FLAT"
Expand Down
22 changes: 22 additions & 0 deletions vectordb_bench/backend/clients/milvus/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,27 @@ def search_param(self) -> dict:
}


class IVFPQConfig(MilvusIndexConfig, DBCaseConfig):
nlist: int
nprobe: int | None = None
m: int = 32
nbits: int = 8
index: IndexType = IndexType.IVFPQ

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

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


class IVFSQ8Config(MilvusIndexConfig, DBCaseConfig):
nlist: int
nprobe: int | None = None
Expand Down Expand Up @@ -397,6 +418,7 @@ def search_param(self) -> dict:
IndexType.HNSW_PRQ: HNSWPRQConfig,
IndexType.DISKANN: DISKANNConfig,
IndexType.IVFFlat: IVFFlatConfig,
IndexType.IVFPQ: IVFPQConfig,
IndexType.IVFSQ8: IVFSQ8Config,
IndexType.IVF_RABITQ: IVFRABITQConfig,
IndexType.Flat: FLATConfig,
Expand Down
11 changes: 7 additions & 4 deletions vectordb_bench/frontend/config/dbCaseConfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class CaseConfigInput(BaseModel):
IndexType.HNSW_PQ.value,
IndexType.HNSW_PRQ.value,
IndexType.IVFFlat.value,
IndexType.IVFPQ.value,
IndexType.IVFSQ8.value,
IndexType.IVF_RABITQ.value,
IndexType.DISKANN.value,
Expand Down Expand Up @@ -631,6 +632,7 @@ class CaseConfigInput(BaseModel):
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [
IndexType.IVFFlat.value,
IndexType.IVFPQ.value,
IndexType.IVFSQ8.value,
IndexType.IVF_RABITQ.value,
IndexType.GPU_IVF_FLAT.value,
Expand All @@ -650,6 +652,7 @@ class CaseConfigInput(BaseModel):
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [
IndexType.IVFFlat.value,
IndexType.IVFPQ.value,
IndexType.IVFSQ8.value,
IndexType.IVF_RABITQ.value,
IndexType.GPU_IVF_FLAT.value,
Expand All @@ -662,12 +665,12 @@ class CaseConfigInput(BaseModel):
label=CaseConfigParamType.m,
inputType=InputType.Number,
inputConfig={
"min": 0,
"min": 1,
"max": 65536,
"value": 0,
"value": 32,
},
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [IndexType.GPU_IVF_PQ.value, IndexType.HNSW_PQ.value, IndexType.HNSW_PRQ.value],
in [IndexType.GPU_IVF_PQ.value, IndexType.HNSW_PQ.value, IndexType.HNSW_PRQ.value, IndexType.IVFPQ.value],
)


Expand All @@ -680,7 +683,7 @@ class CaseConfigInput(BaseModel):
"value": 8,
},
isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
in [IndexType.GPU_IVF_PQ.value, IndexType.HNSW_PQ.value, IndexType.HNSW_PRQ.value],
in [IndexType.GPU_IVF_PQ.value, IndexType.HNSW_PQ.value, IndexType.HNSW_PRQ.value, IndexType.IVFPQ.value],
)

CaseConfigParamInput_NRQ = CaseConfigInput(
Expand Down