vectordb-bench 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. vectordb_bench/backend/clients/__init__.py +4 -4
  2. vectordb_bench/backend/clients/api.py +1 -0
  3. vectordb_bench/backend/clients/milvus/milvus.py +2 -3
  4. vectordb_bench/backend/clients/pgvecto_rs/config.py +44 -32
  5. vectordb_bench/backend/clients/pgvecto_rs/pgvecto_rs.py +16 -16
  6. vectordb_bench/backend/clients/pgvector/config.py +178 -24
  7. vectordb_bench/backend/clients/pgvector/pgvector.py +244 -70
  8. vectordb_bench/backend/clients/qdrant_cloud/config.py +19 -6
  9. vectordb_bench/backend/clients/qdrant_cloud/qdrant_cloud.py +11 -7
  10. vectordb_bench/backend/runner/serial_runner.py +0 -2
  11. vectordb_bench/backend/task_runner.py +1 -1
  12. vectordb_bench/frontend/components/run_test/caseSelector.py +6 -3
  13. vectordb_bench/frontend/const/dbCaseConfigs.py +128 -3
  14. vectordb_bench/models.py +6 -3
  15. vectordb_bench/results/PgVector/result_20230727_standard_pgvector.json +8 -0
  16. vectordb_bench/results/PgVector/result_20230808_standard_pgvector.json +9 -3
  17. vectordb_bench/results/ZillizCloud/{result_20240105_beta_202401_zillizcloud.json → result_20240105_standard_202401_zillizcloud.json} +365 -41
  18. vectordb_bench/results/getLeaderboardData.py +1 -1
  19. vectordb_bench/results/leaderboard.json +1 -1
  20. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/METADATA +4 -3
  21. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/RECORD +25 -25
  22. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/LICENSE +0 -0
  23. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/WHEEL +0 -0
  24. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/entry_points.txt +0 -0
  25. {vectordb_bench-0.0.7.dist-info → vectordb_bench-0.0.9.dist-info}/top_level.txt +0 -0
@@ -49,6 +49,8 @@ class CaseConfigInput(BaseModel):
49
49
  label: CaseConfigParamType
50
50
  inputType: InputType = InputType.Text
51
51
  inputConfig: dict = {}
52
+ inputHelp: str = ""
53
+ displayLabel: str = ""
52
54
  # todo type should be a function
53
55
  isDisplayed: typing.Any = lambda x: True
54
56
 
@@ -71,6 +73,18 @@ CaseConfigParamInput_IndexType = CaseConfigInput(
71
73
  },
72
74
  )
73
75
 
76
+ CaseConfigParamInput_IndexType_PgVector = CaseConfigInput(
77
+ label=CaseConfigParamType.IndexType,
78
+ inputHelp="Select Index Type",
79
+ inputType=InputType.Option,
80
+ inputConfig={
81
+ "options": [
82
+ IndexType.HNSW.value,
83
+ IndexType.IVFFlat.value,
84
+ ],
85
+ },
86
+ )
87
+
74
88
  CaseConfigParamInput_M = CaseConfigInput(
75
89
  label=CaseConfigParamType.M,
76
90
  inputType=InputType.Number,
@@ -83,6 +97,19 @@ CaseConfigParamInput_M = CaseConfigInput(
83
97
  == IndexType.HNSW.value,
84
98
  )
85
99
 
100
+ CaseConfigParamInput_m = CaseConfigInput(
101
+ label=CaseConfigParamType.m,
102
+ inputType=InputType.Number,
103
+ inputConfig={
104
+ "min": 4,
105
+ "max": 64,
106
+ "value": 16,
107
+ },
108
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
109
+ == IndexType.HNSW.value,
110
+ )
111
+
112
+
86
113
  CaseConfigParamInput_EFConstruction_Milvus = CaseConfigInput(
87
114
  label=CaseConfigParamType.EFConstruction,
88
115
  inputType=InputType.Number,
@@ -115,6 +142,30 @@ CaseConfigParamInput_EFConstruction_ES = CaseConfigInput(
115
142
  },
116
143
  )
117
144
 
145
+ CaseConfigParamInput_maintenance_work_mem_PgVector = CaseConfigInput(
146
+ label=CaseConfigParamType.maintenance_work_mem,
147
+ inputHelp="Recommended value: 1.33x the index size, not to exceed the available free memory."
148
+ "Specify in gigabytes. e.g. 8GB",
149
+ inputType=InputType.Text,
150
+ inputConfig={
151
+ "value": "8GB",
152
+ },
153
+ )
154
+
155
+ CaseConfigParamInput_max_parallel_workers_PgVector = CaseConfigInput(
156
+ label=CaseConfigParamType.max_parallel_workers,
157
+ displayLabel="Max parallel workers",
158
+ inputHelp="Recommended value: (cpu cores - 1). This will set the parameters: max_parallel_maintenance_workers,"
159
+ " max_parallel_workers & table(parallel_workers)",
160
+ inputType=InputType.Number,
161
+ inputConfig={
162
+ "min": 0,
163
+ "max": 1024,
164
+ "value": 16,
165
+ },
166
+ )
167
+
168
+
118
169
  CaseConfigParamInput_EFConstruction_PgVectoRS = CaseConfigInput(
119
170
  label=CaseConfigParamType.EFConstruction,
120
171
  inputType=InputType.Number,
@@ -127,6 +178,19 @@ CaseConfigParamInput_EFConstruction_PgVectoRS = CaseConfigInput(
127
178
  == IndexType.HNSW.value,
128
179
  )
129
180
 
181
+ CaseConfigParamInput_EFConstruction_PgVector = CaseConfigInput(
182
+ label=CaseConfigParamType.ef_construction,
183
+ inputType=InputType.Number,
184
+ inputConfig={
185
+ "min": 8,
186
+ "max": 1024,
187
+ "value": 256,
188
+ },
189
+ isDisplayed=lambda config: config[CaseConfigParamType.IndexType]
190
+ == IndexType.HNSW.value,
191
+ )
192
+
193
+
130
194
  CaseConfigParamInput_M_ES = CaseConfigInput(
131
195
  label=CaseConfigParamType.M,
132
196
  inputType=InputType.Number,
@@ -379,6 +443,8 @@ CaseConfigParamInput_Lists = CaseConfigInput(
379
443
  "max": 65536,
380
444
  "value": 10,
381
445
  },
446
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
447
+ in [IndexType.IVFFlat.value],
382
448
  )
383
449
 
384
450
  CaseConfigParamInput_Probes = CaseConfigInput(
@@ -391,12 +457,53 @@ CaseConfigParamInput_Probes = CaseConfigInput(
391
457
  },
392
458
  )
393
459
 
460
+ CaseConfigParamInput_Lists_PgVector = CaseConfigInput(
461
+ label=CaseConfigParamType.lists,
462
+ inputType=InputType.Number,
463
+ inputConfig={
464
+ "min": 1,
465
+ "max": 65536,
466
+ "value": 10,
467
+ },
468
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
469
+ == IndexType.IVFFlat.value,
470
+ )
471
+
472
+ CaseConfigParamInput_Probes_PgVector = CaseConfigInput(
473
+ label=CaseConfigParamType.probes,
474
+ inputType=InputType.Number,
475
+ inputConfig={
476
+ "min": 1,
477
+ "max": 65536,
478
+ "value": 1,
479
+ },
480
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
481
+ == IndexType.IVFFlat.value,
482
+ )
483
+
484
+ CaseConfigParamInput_EFSearch_PgVector = CaseConfigInput(
485
+ label=CaseConfigParamType.ef_search,
486
+ inputType=InputType.Number,
487
+ inputConfig={
488
+ "min": 1,
489
+ "max": 2048,
490
+ "value": 256,
491
+ },
492
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
493
+ == IndexType.HNSW.value,
494
+ )
495
+
394
496
  CaseConfigParamInput_QuantizationType_PgVectoRS = CaseConfigInput(
395
497
  label=CaseConfigParamType.quantizationType,
396
498
  inputType=InputType.Option,
397
499
  inputConfig={
398
500
  "options": ["trivial", "scalar", "product"],
399
501
  },
502
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
503
+ in [
504
+ IndexType.HNSW.value,
505
+ IndexType.IVFFlat.value,
506
+ ],
400
507
  )
401
508
 
402
509
  CaseConfigParamInput_QuantizationRatio_PgVectoRS = CaseConfigInput(
@@ -406,7 +513,11 @@ CaseConfigParamInput_QuantizationRatio_PgVectoRS = CaseConfigInput(
406
513
  "options": ["x4", "x8", "x16", "x32", "x64"],
407
514
  },
408
515
  isDisplayed=lambda config: config.get(CaseConfigParamType.quantizationType, None)
409
- == "product",
516
+ == "product" and config.get(CaseConfigParamType.IndexType, None)
517
+ in [
518
+ IndexType.HNSW.value,
519
+ IndexType.IVFFlat.value,
520
+ ],
410
521
  )
411
522
 
412
523
  CaseConfigParamInput_ZillizLevel = CaseConfigInput(
@@ -470,8 +581,22 @@ ESPerformanceConfig = [
470
581
  CaseConfigParamInput_NumCandidates_ES,
471
582
  ]
472
583
 
473
- PgVectorLoadingConfig = [CaseConfigParamInput_Lists]
474
- PgVectorPerformanceConfig = [CaseConfigParamInput_Lists, CaseConfigParamInput_Probes]
584
+ PgVectorLoadingConfig = [CaseConfigParamInput_IndexType_PgVector,
585
+ CaseConfigParamInput_Lists_PgVector,
586
+ CaseConfigParamInput_m,
587
+ CaseConfigParamInput_EFConstruction_PgVector,
588
+ CaseConfigParamInput_maintenance_work_mem_PgVector,
589
+ CaseConfigParamInput_max_parallel_workers_PgVector,
590
+ ]
591
+ PgVectorPerformanceConfig = [CaseConfigParamInput_IndexType_PgVector,
592
+ CaseConfigParamInput_m,
593
+ CaseConfigParamInput_EFConstruction_PgVector,
594
+ CaseConfigParamInput_EFSearch_PgVector,
595
+ CaseConfigParamInput_Lists_PgVector,
596
+ CaseConfigParamInput_Probes_PgVector,
597
+ CaseConfigParamInput_maintenance_work_mem_PgVector,
598
+ CaseConfigParamInput_max_parallel_workers_PgVector,
599
+ ]
475
600
 
476
601
  PgVectoRSLoadingConfig = [
477
602
  CaseConfigParamInput_IndexType,
vectordb_bench/models.py CHANGED
@@ -1,8 +1,8 @@
1
1
  import logging
2
2
  import pathlib
3
3
  from datetime import date
4
- from typing import Self
5
- from enum import Enum
4
+ from enum import Enum, StrEnum, auto
5
+ from typing import List, Self, Sequence, Set
6
6
 
7
7
  import ujson
8
8
 
@@ -37,8 +37,10 @@ class CaseConfigParamType(Enum):
37
37
  IndexType = "IndexType"
38
38
  M = "M"
39
39
  EFConstruction = "efConstruction"
40
+ ef_construction = "ef_construction"
40
41
  EF = "ef"
41
42
  SearchList = "search_list"
43
+ ef_search = "ef_search"
42
44
  Nlist = "nlist"
43
45
  Nprobe = "nprobe"
44
46
  MaxConnections = "maxConnections"
@@ -60,7 +62,8 @@ class CaseConfigParamType(Enum):
60
62
  cache_dataset_on_device = "cache_dataset_on_device"
61
63
  refine_ratio = "refine_ratio"
62
64
  level = "level"
63
-
65
+ maintenance_work_mem = "maintenance_work_mem"
66
+ max_parallel_workers = "max_parallel_workers"
64
67
 
65
68
  class CustomizedCase(BaseModel):
66
69
  pass
@@ -20,6 +20,7 @@
20
20
  "db_name": "**********"
21
21
  },
22
22
  "db_case_config": {
23
+ "index": "IVF_FLAT",
23
24
  "metric_type": "L2",
24
25
  "lists": 10,
25
26
  "probes": 2
@@ -49,6 +50,7 @@
49
50
  "db_name": "**********"
50
51
  },
51
52
  "db_case_config": {
53
+ "index": "IVF_FLAT",
52
54
  "metric_type": "L2",
53
55
  "lists": 10,
54
56
  "probes": 2
@@ -78,6 +80,7 @@
78
80
  "db_name": "**********"
79
81
  },
80
82
  "db_case_config": {
83
+ "index": "IVF_FLAT",
81
84
  "metric_type": "COSINE",
82
85
  "lists": 10,
83
86
  "probes": 2
@@ -107,6 +110,7 @@
107
110
  "db_name": "**********"
108
111
  },
109
112
  "db_case_config": {
113
+ "index": "IVF_FLAT",
110
114
  "metric_type": "COSINE",
111
115
  "lists": 10,
112
116
  "probes": 2
@@ -136,6 +140,7 @@
136
140
  "db_name": "**********"
137
141
  },
138
142
  "db_case_config": {
143
+ "index": "IVF_FLAT",
139
144
  "metric_type": "COSINE",
140
145
  "lists": 10,
141
146
  "probes": 2
@@ -165,6 +170,7 @@
165
170
  "db_name": "**********"
166
171
  },
167
172
  "db_case_config": {
173
+ "index": "IVF_FLAT",
168
174
  "metric_type": "COSINE",
169
175
  "lists": 10,
170
176
  "probes": 2
@@ -194,6 +200,7 @@
194
200
  "db_name": "**********"
195
201
  },
196
202
  "db_case_config": {
203
+ "index": "IVF_FLAT",
197
204
  "metric_type": "COSINE",
198
205
  "lists": 10,
199
206
  "probes": 2
@@ -223,6 +230,7 @@
223
230
  "db_name": "**********"
224
231
  },
225
232
  "db_case_config": {
233
+ "index": "IVF_FLAT",
226
234
  "metric_type": "COSINE",
227
235
  "lists": 10,
228
236
  "probes": 2
@@ -20,6 +20,7 @@
20
20
  "db_name": "**********"
21
21
  },
22
22
  "db_case_config": {
23
+ "index": "IVF_FLAT",
23
24
  "metric_type": "L2",
24
25
  "lists": 10,
25
26
  "probes": 2
@@ -51,7 +52,8 @@
51
52
  "db_case_config": {
52
53
  "metric_type": "L2",
53
54
  "lists": 10,
54
- "probes": 2
55
+ "probes": 2,
56
+ "index": "IVF_FLAT"
55
57
  },
56
58
  "case_config": {
57
59
  "case_id": 11,
@@ -80,7 +82,8 @@
80
82
  "db_case_config": {
81
83
  "metric_type": "L2",
82
84
  "lists": 10,
83
- "probes": 2
85
+ "probes": 2,
86
+ "index": "IVF_FLAT"
84
87
  },
85
88
  "case_config": {
86
89
  "case_id": 12,
@@ -107,6 +110,7 @@
107
110
  "db_name": "**********"
108
111
  },
109
112
  "db_case_config": {
113
+ "index": "IVF_FLAT",
110
114
  "metric_type": "L2",
111
115
  "lists": 10,
112
116
  "probes": 2
@@ -136,6 +140,7 @@
136
140
  "db_name": "**********"
137
141
  },
138
142
  "db_case_config": {
143
+ "index": "IVF_FLAT",
139
144
  "metric_type": "L2",
140
145
  "lists": 10,
141
146
  "probes": 2
@@ -165,6 +170,7 @@
165
170
  "db_name": "**********"
166
171
  },
167
172
  "db_case_config": {
173
+ "index": "IVF_FLAT",
168
174
  "metric_type": "L2",
169
175
  "lists": 10,
170
176
  "probes": 2
@@ -178,4 +184,4 @@
178
184
  }
179
185
  ],
180
186
  "file_fmt": "result_{}_{}_{}.json"
181
- }
187
+ }