vectordb-bench 0.0.11__py3-none-any.whl → 0.0.13__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 (57) hide show
  1. vectordb_bench/__init__.py +1 -0
  2. vectordb_bench/backend/assembler.py +1 -1
  3. vectordb_bench/backend/cases.py +64 -18
  4. vectordb_bench/backend/clients/__init__.py +35 -0
  5. vectordb_bench/backend/clients/api.py +21 -1
  6. vectordb_bench/backend/clients/aws_opensearch/aws_opensearch.py +159 -0
  7. vectordb_bench/backend/clients/aws_opensearch/cli.py +44 -0
  8. vectordb_bench/backend/clients/aws_opensearch/config.py +58 -0
  9. vectordb_bench/backend/clients/aws_opensearch/run.py +125 -0
  10. vectordb_bench/backend/clients/memorydb/cli.py +88 -0
  11. vectordb_bench/backend/clients/memorydb/config.py +54 -0
  12. vectordb_bench/backend/clients/memorydb/memorydb.py +254 -0
  13. vectordb_bench/backend/clients/pgvecto_rs/cli.py +154 -0
  14. vectordb_bench/backend/clients/pgvecto_rs/config.py +108 -73
  15. vectordb_bench/backend/clients/pgvecto_rs/pgvecto_rs.py +159 -59
  16. vectordb_bench/backend/clients/pgvectorscale/config.py +111 -0
  17. vectordb_bench/backend/clients/pgvectorscale/pgvectorscale.py +272 -0
  18. vectordb_bench/backend/dataset.py +27 -5
  19. vectordb_bench/cli/vectordbbench.py +7 -0
  20. vectordb_bench/custom/custom_case.json +18 -0
  21. vectordb_bench/frontend/components/check_results/charts.py +6 -6
  22. vectordb_bench/frontend/components/check_results/data.py +18 -11
  23. vectordb_bench/frontend/components/check_results/expanderStyle.py +1 -1
  24. vectordb_bench/frontend/components/check_results/filters.py +20 -13
  25. vectordb_bench/frontend/components/check_results/headerIcon.py +1 -1
  26. vectordb_bench/frontend/components/check_results/priceTable.py +1 -1
  27. vectordb_bench/frontend/components/check_results/stPageConfig.py +1 -1
  28. vectordb_bench/frontend/components/concurrent/charts.py +26 -29
  29. vectordb_bench/frontend/components/custom/displayCustomCase.py +31 -0
  30. vectordb_bench/frontend/components/custom/displaypPrams.py +11 -0
  31. vectordb_bench/frontend/components/custom/getCustomConfig.py +40 -0
  32. vectordb_bench/frontend/components/custom/initStyle.py +15 -0
  33. vectordb_bench/frontend/components/run_test/autoRefresh.py +1 -1
  34. vectordb_bench/frontend/components/run_test/caseSelector.py +50 -28
  35. vectordb_bench/frontend/components/run_test/dbConfigSetting.py +37 -19
  36. vectordb_bench/frontend/components/run_test/dbSelector.py +2 -14
  37. vectordb_bench/frontend/components/run_test/generateTasks.py +3 -5
  38. vectordb_bench/frontend/components/run_test/initStyle.py +16 -0
  39. vectordb_bench/frontend/components/run_test/submitTask.py +1 -1
  40. vectordb_bench/frontend/{const → config}/dbCaseConfigs.py +311 -40
  41. vectordb_bench/frontend/{const → config}/styles.py +2 -0
  42. vectordb_bench/frontend/pages/concurrent.py +11 -18
  43. vectordb_bench/frontend/pages/custom.py +64 -0
  44. vectordb_bench/frontend/pages/quries_per_dollar.py +5 -5
  45. vectordb_bench/frontend/pages/run_test.py +4 -0
  46. vectordb_bench/frontend/pages/tables.py +2 -2
  47. vectordb_bench/frontend/utils.py +17 -1
  48. vectordb_bench/frontend/vdb_benchmark.py +3 -3
  49. vectordb_bench/models.py +26 -10
  50. vectordb_bench/results/getLeaderboardData.py +1 -1
  51. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/METADATA +46 -15
  52. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/RECORD +57 -40
  53. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/WHEEL +1 -1
  54. /vectordb_bench/frontend/{const → config}/dbPrices.py +0 -0
  55. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/LICENSE +0 -0
  56. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/entry_points.txt +0 -0
  57. {vectordb_bench-0.0.11.dist-info → vectordb_bench-0.0.13.dist-info}/top_level.txt +0 -0
@@ -1,49 +1,154 @@
1
- from enum import IntEnum
1
+ from enum import IntEnum, Enum
2
2
  import typing
3
3
  from pydantic import BaseModel
4
4
  from vectordb_bench.backend.cases import CaseLabel, CaseType
5
5
  from vectordb_bench.backend.clients import DB
6
6
  from vectordb_bench.backend.clients.api import IndexType
7
+ from vectordb_bench.frontend.components.custom.getCustomConfig import get_custom_configs
7
8
 
8
- from vectordb_bench.models import CaseConfigParamType
9
+ from vectordb_bench.models import CaseConfig, CaseConfigParamType
9
10
 
10
11
  MAX_STREAMLIT_INT = (1 << 53) - 1
11
12
 
12
13
  DB_LIST = [d for d in DB if d != DB.Test]
13
14
 
14
- DIVIDER = "DIVIDER"
15
- CASE_LIST_WITH_DIVIDER = [
15
+
16
+ class Delimiter(Enum):
17
+ Line = "line"
18
+
19
+
20
+ class BatchCaseConfig(BaseModel):
21
+ label: str = ""
22
+ description: str = ""
23
+ cases: list[CaseConfig] = []
24
+
25
+
26
+ class UICaseItem(BaseModel):
27
+ isLine: bool = False
28
+ label: str = ""
29
+ description: str = ""
30
+ cases: list[CaseConfig] = []
31
+ caseLabel: CaseLabel = CaseLabel.Performance
32
+
33
+ def __init__(
34
+ self,
35
+ isLine: bool = False,
36
+ case_id: CaseType = None,
37
+ custom_case: dict = {},
38
+ cases: list[CaseConfig] = [],
39
+ label: str = "",
40
+ description: str = "",
41
+ caseLabel: CaseLabel = CaseLabel.Performance,
42
+ ):
43
+ if isLine is True:
44
+ super().__init__(isLine=True)
45
+ elif case_id is not None and isinstance(case_id, CaseType):
46
+ c = case_id.case_cls(custom_case)
47
+ super().__init__(
48
+ label=c.name,
49
+ description=c.description,
50
+ cases=[CaseConfig(case_id=case_id, custom_case=custom_case)],
51
+ caseLabel=c.label,
52
+ )
53
+ else:
54
+ super().__init__(
55
+ label=label,
56
+ description=description,
57
+ cases=cases,
58
+ caseLabel=caseLabel,
59
+ )
60
+
61
+ def __hash__(self) -> int:
62
+ return hash(self.json())
63
+
64
+
65
+ class UICaseItemCluster(BaseModel):
66
+ label: str = ""
67
+ uiCaseItems: list[UICaseItem] = []
68
+
69
+
70
+ def get_custom_case_items() -> list[UICaseItem]:
71
+ custom_configs = get_custom_configs()
72
+ return [
73
+ UICaseItem(
74
+ case_id=CaseType.PerformanceCustomDataset, custom_case=custom_config.dict()
75
+ )
76
+ for custom_config in custom_configs
77
+ ]
78
+
79
+
80
+ def get_custom_case_cluter() -> UICaseItemCluster:
81
+ return UICaseItemCluster(
82
+ label="Custom Search Performance Test", uiCaseItems=get_custom_case_items()
83
+ )
84
+
85
+
86
+ UI_CASE_CLUSTERS: list[UICaseItemCluster] = [
87
+ UICaseItemCluster(
88
+ label="Search Performance Test",
89
+ uiCaseItems=[
90
+ UICaseItem(case_id=CaseType.Performance768D100M),
91
+ UICaseItem(case_id=CaseType.Performance768D10M),
92
+ UICaseItem(case_id=CaseType.Performance768D1M),
93
+ UICaseItem(isLine=True),
94
+ UICaseItem(case_id=CaseType.Performance1536D5M),
95
+ UICaseItem(case_id=CaseType.Performance1536D500K),
96
+ UICaseItem(case_id=CaseType.Performance1536D50K),
97
+ ],
98
+ ),
99
+ UICaseItemCluster(
100
+ label="Filter Search Performance Test",
101
+ uiCaseItems=[
102
+ UICaseItem(case_id=CaseType.Performance768D10M1P),
103
+ UICaseItem(case_id=CaseType.Performance768D10M99P),
104
+ UICaseItem(case_id=CaseType.Performance768D1M1P),
105
+ UICaseItem(case_id=CaseType.Performance768D1M99P),
106
+ UICaseItem(isLine=True),
107
+ UICaseItem(case_id=CaseType.Performance1536D5M1P),
108
+ UICaseItem(case_id=CaseType.Performance1536D5M99P),
109
+ UICaseItem(case_id=CaseType.Performance1536D500K1P),
110
+ UICaseItem(case_id=CaseType.Performance1536D500K99P),
111
+ ],
112
+ ),
113
+ UICaseItemCluster(
114
+ label="Capacity Test",
115
+ uiCaseItems=[
116
+ UICaseItem(case_id=CaseType.CapacityDim960),
117
+ UICaseItem(case_id=CaseType.CapacityDim128),
118
+ ],
119
+ ),
120
+ ]
121
+
122
+ # DIVIDER = "DIVIDER"
123
+ DISPLAY_CASE_ORDER: list[CaseType] = [
16
124
  CaseType.Performance768D100M,
17
125
  CaseType.Performance768D10M,
18
126
  CaseType.Performance768D1M,
19
- DIVIDER,
20
127
  CaseType.Performance1536D5M,
21
128
  CaseType.Performance1536D500K,
22
129
  CaseType.Performance1536D50K,
23
- DIVIDER,
24
130
  CaseType.Performance768D10M1P,
25
131
  CaseType.Performance768D1M1P,
26
- DIVIDER,
27
132
  CaseType.Performance1536D5M1P,
28
133
  CaseType.Performance1536D500K1P,
29
- DIVIDER,
30
134
  CaseType.Performance768D10M99P,
31
135
  CaseType.Performance768D1M99P,
32
- DIVIDER,
33
136
  CaseType.Performance1536D5M99P,
34
137
  CaseType.Performance1536D500K99P,
35
- DIVIDER,
36
138
  CaseType.CapacityDim960,
37
139
  CaseType.CapacityDim128,
38
140
  ]
141
+ CASE_NAME_ORDER = [case.case_cls().name for case in DISPLAY_CASE_ORDER]
39
142
 
40
- CASE_LIST = [item for item in CASE_LIST_WITH_DIVIDER if isinstance(item, CaseType)]
143
+ # CASE_LIST = [
144
+ # item for item in CASE_LIST_WITH_DIVIDER if isinstance(item, CaseType)]
41
145
 
42
146
 
43
147
  class InputType(IntEnum):
44
148
  Text = 20001
45
149
  Number = 20002
46
150
  Option = 20003
151
+ Float = 20004
47
152
 
48
153
 
49
154
  class CaseConfigInput(BaseModel):
@@ -53,7 +158,7 @@ class CaseConfigInput(BaseModel):
53
158
  inputHelp: str = ""
54
159
  displayLabel: str = ""
55
160
  # todo type should be a function
56
- isDisplayed: typing.Any = lambda x: True
161
+ isDisplayed: typing.Any = lambda config: True
57
162
 
58
163
 
59
164
  CaseConfigParamInput_IndexType = CaseConfigInput(
@@ -65,6 +170,7 @@ CaseConfigParamInput_IndexType = CaseConfigInput(
65
170
  IndexType.IVFFlat.value,
66
171
  IndexType.IVFSQ8.value,
67
172
  IndexType.DISKANN.value,
173
+ IndexType.STREAMING_DISKANN.value,
68
174
  IndexType.Flat.value,
69
175
  IndexType.AUTOINDEX.value,
70
176
  IndexType.GPU_IVF_FLAT.value,
@@ -74,6 +180,104 @@ CaseConfigParamInput_IndexType = CaseConfigInput(
74
180
  },
75
181
  )
76
182
 
183
+
184
+ CaseConfigParamInput_IndexType_PgVectorScale = CaseConfigInput(
185
+ label=CaseConfigParamType.IndexType,
186
+ inputHelp="Select Index Type",
187
+ inputType=InputType.Option,
188
+ inputConfig={
189
+ "options": [
190
+ IndexType.STREAMING_DISKANN.value,
191
+ ],
192
+ },
193
+ )
194
+
195
+
196
+ CaseConfigParamInput_storage_layout = CaseConfigInput(
197
+ label=CaseConfigParamType.storage_layout,
198
+ inputHelp="Select Storage Layout",
199
+ inputType=InputType.Option,
200
+ inputConfig={
201
+ "options": [
202
+ "memory_optimized",
203
+ "plain",
204
+ ],
205
+ },
206
+ )
207
+
208
+ CaseConfigParamInput_num_neighbors = CaseConfigInput(
209
+ label=CaseConfigParamType.num_neighbors,
210
+ inputType=InputType.Number,
211
+ inputConfig={
212
+ "min": 10,
213
+ "max": 300,
214
+ "value": 50,
215
+ },
216
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
217
+ == IndexType.STREAMING_DISKANN.value,
218
+ )
219
+
220
+ CaseConfigParamInput_search_list_size = CaseConfigInput(
221
+ label=CaseConfigParamType.search_list_size,
222
+ inputType=InputType.Number,
223
+ inputConfig={
224
+ "min": 10,
225
+ "max": 300,
226
+ "value": 100,
227
+ },
228
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
229
+ == IndexType.STREAMING_DISKANN.value,
230
+ )
231
+
232
+ CaseConfigParamInput_max_alpha = CaseConfigInput(
233
+ label=CaseConfigParamType.max_alpha,
234
+ inputType=InputType.Float,
235
+ inputConfig={
236
+ "min": 0.1,
237
+ "max": 2.0,
238
+ "value": 1.2,
239
+ },
240
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
241
+ == IndexType.STREAMING_DISKANN.value,
242
+ )
243
+
244
+ CaseConfigParamInput_num_dimensions = CaseConfigInput(
245
+ label=CaseConfigParamType.num_dimensions,
246
+ inputType=InputType.Number,
247
+ inputConfig={
248
+ "min": 0,
249
+ "max": 2000,
250
+ "value": 0,
251
+ },
252
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
253
+ == IndexType.STREAMING_DISKANN.value,
254
+ )
255
+
256
+ CaseConfigParamInput_query_search_list_size = CaseConfigInput(
257
+ label=CaseConfigParamType.query_search_list_size,
258
+ inputType=InputType.Number,
259
+ inputConfig={
260
+ "min": 50,
261
+ "max": 150,
262
+ "value": 100,
263
+ },
264
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
265
+ == IndexType.STREAMING_DISKANN.value,
266
+ )
267
+
268
+
269
+ CaseConfigParamInput_query_rescore = CaseConfigInput(
270
+ label=CaseConfigParamType.query_rescore,
271
+ inputType=InputType.Number,
272
+ inputConfig={
273
+ "min": 0,
274
+ "max": 150,
275
+ "value": 50,
276
+ },
277
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
278
+ == IndexType.STREAMING_DISKANN.value,
279
+ )
280
+
77
281
  CaseConfigParamInput_IndexType_PgVector = CaseConfigInput(
78
282
  label=CaseConfigParamType.IndexType,
79
283
  inputHelp="Select Index Type",
@@ -86,6 +290,19 @@ CaseConfigParamInput_IndexType_PgVector = CaseConfigInput(
86
290
  },
87
291
  )
88
292
 
293
+ CaseConfigParamInput_IndexType_PgVectoRS = CaseConfigInput(
294
+ label=CaseConfigParamType.IndexType,
295
+ inputHelp="Select Index Type",
296
+ inputType=InputType.Option,
297
+ inputConfig={
298
+ "options": [
299
+ IndexType.HNSW.value,
300
+ IndexType.IVFFlat.value,
301
+ IndexType.Flat.value,
302
+ ],
303
+ },
304
+ )
305
+
89
306
  CaseConfigParamInput_M = CaseConfigInput(
90
307
  label=CaseConfigParamType.M,
91
308
  inputType=InputType.Number,
@@ -146,7 +363,7 @@ CaseConfigParamInput_EFConstruction_ES = CaseConfigInput(
146
363
  CaseConfigParamInput_maintenance_work_mem_PgVector = CaseConfigInput(
147
364
  label=CaseConfigParamType.maintenance_work_mem,
148
365
  inputHelp="Recommended value: 1.33x the index size, not to exceed the available free memory."
149
- "Specify in gigabytes. e.g. 8GB",
366
+ "Specify in gigabytes. e.g. 8GB",
150
367
  inputType=InputType.Text,
151
368
  inputConfig={
152
369
  "value": "8GB",
@@ -157,7 +374,7 @@ CaseConfigParamInput_max_parallel_workers_PgVector = CaseConfigInput(
157
374
  label=CaseConfigParamType.max_parallel_workers,
158
375
  displayLabel="Max parallel workers",
159
376
  inputHelp="Recommended value: (cpu cores - 1). This will set the parameters: max_parallel_maintenance_workers,"
160
- " max_parallel_workers & table(parallel_workers)",
377
+ " max_parallel_workers & table(parallel_workers)",
161
378
  inputType=InputType.Number,
162
379
  inputConfig={
163
380
  "min": 0,
@@ -168,14 +385,26 @@ CaseConfigParamInput_max_parallel_workers_PgVector = CaseConfigInput(
168
385
 
169
386
 
170
387
  CaseConfigParamInput_EFConstruction_PgVectoRS = CaseConfigInput(
171
- label=CaseConfigParamType.EFConstruction,
388
+ label=CaseConfigParamType.ef_construction,
172
389
  inputType=InputType.Number,
173
390
  inputConfig={
174
- "min": 8,
175
- "max": 512,
176
- "value": 360,
391
+ "min": 10,
392
+ "max": 2000,
393
+ "value": 300,
177
394
  },
178
- isDisplayed=lambda config: config[CaseConfigParamType.IndexType]
395
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
396
+ == IndexType.HNSW.value,
397
+ )
398
+
399
+ CaseConfigParamInput_EFSearch_PgVectoRS = CaseConfigInput(
400
+ label=CaseConfigParamType.ef_search,
401
+ inputType=InputType.Number,
402
+ inputConfig={
403
+ "min": 1,
404
+ "max": 65535,
405
+ "value": 100,
406
+ },
407
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
179
408
  == IndexType.HNSW.value,
180
409
  )
181
410
 
@@ -298,6 +527,7 @@ CaseConfigParamInput_M_PQ = CaseConfigInput(
298
527
  in [IndexType.GPU_IVF_PQ.value],
299
528
  )
300
529
 
530
+
301
531
  CaseConfigParamInput_Nbits_PQ = CaseConfigInput(
302
532
  label=CaseConfigParamType.nbits,
303
533
  inputType=InputType.Number,
@@ -494,6 +724,7 @@ CaseConfigParamInput_EFSearch_PgVector = CaseConfigInput(
494
724
  == IndexType.HNSW.value,
495
725
  )
496
726
 
727
+
497
728
  CaseConfigParamInput_QuantizationType_PgVectoRS = CaseConfigInput(
498
729
  label=CaseConfigParamType.quantizationType,
499
730
  inputType=InputType.Option,
@@ -514,13 +745,26 @@ CaseConfigParamInput_QuantizationRatio_PgVectoRS = CaseConfigInput(
514
745
  "options": ["x4", "x8", "x16", "x32", "x64"],
515
746
  },
516
747
  isDisplayed=lambda config: config.get(CaseConfigParamType.quantizationType, None)
517
- == "product" and config.get(CaseConfigParamType.IndexType, None)
748
+ == "product"
749
+ and config.get(CaseConfigParamType.IndexType, None)
518
750
  in [
519
751
  IndexType.HNSW.value,
520
752
  IndexType.IVFFlat.value,
521
753
  ],
522
754
  )
523
755
 
756
+ CaseConfigParamInput_max_parallel_workers_PgVectorRS = CaseConfigInput(
757
+ label=CaseConfigParamType.max_parallel_workers,
758
+ displayLabel="Max parallel workers",
759
+ inputHelp="Recommended value: (cpu cores - 1). This will set the parameters: [optimizing.optimizing_threads]",
760
+ inputType=InputType.Number,
761
+ inputConfig={
762
+ "min": 0,
763
+ "max": 1024,
764
+ "value": 16,
765
+ },
766
+ )
767
+
524
768
  CaseConfigParamInput_ZillizLevel = CaseConfigInput(
525
769
  label=CaseConfigParamType.level,
526
770
  inputType=InputType.Number,
@@ -582,46 +826,69 @@ ESPerformanceConfig = [
582
826
  CaseConfigParamInput_NumCandidates_ES,
583
827
  ]
584
828
 
585
- PgVectorLoadingConfig = [CaseConfigParamInput_IndexType_PgVector,
586
- CaseConfigParamInput_Lists_PgVector,
587
- CaseConfigParamInput_m,
588
- CaseConfigParamInput_EFConstruction_PgVector,
589
- CaseConfigParamInput_maintenance_work_mem_PgVector,
590
- CaseConfigParamInput_max_parallel_workers_PgVector,
591
- ]
592
- PgVectorPerformanceConfig = [CaseConfigParamInput_IndexType_PgVector,
593
- CaseConfigParamInput_m,
594
- CaseConfigParamInput_EFConstruction_PgVector,
595
- CaseConfigParamInput_EFSearch_PgVector,
596
- CaseConfigParamInput_Lists_PgVector,
597
- CaseConfigParamInput_Probes_PgVector,
598
- CaseConfigParamInput_maintenance_work_mem_PgVector,
599
- CaseConfigParamInput_max_parallel_workers_PgVector,
600
- ]
829
+ PgVectorLoadingConfig = [
830
+ CaseConfigParamInput_IndexType_PgVector,
831
+ CaseConfigParamInput_Lists_PgVector,
832
+ CaseConfigParamInput_m,
833
+ CaseConfigParamInput_EFConstruction_PgVector,
834
+ CaseConfigParamInput_maintenance_work_mem_PgVector,
835
+ CaseConfigParamInput_max_parallel_workers_PgVector,
836
+ ]
837
+ PgVectorPerformanceConfig = [
838
+ CaseConfigParamInput_IndexType_PgVector,
839
+ CaseConfigParamInput_m,
840
+ CaseConfigParamInput_EFConstruction_PgVector,
841
+ CaseConfigParamInput_EFSearch_PgVector,
842
+ CaseConfigParamInput_Lists_PgVector,
843
+ CaseConfigParamInput_Probes_PgVector,
844
+ CaseConfigParamInput_maintenance_work_mem_PgVector,
845
+ CaseConfigParamInput_max_parallel_workers_PgVector,
846
+ ]
601
847
 
602
848
  PgVectoRSLoadingConfig = [
603
- CaseConfigParamInput_IndexType,
604
- CaseConfigParamInput_M,
849
+ CaseConfigParamInput_IndexType_PgVectoRS,
850
+ CaseConfigParamInput_m,
605
851
  CaseConfigParamInput_EFConstruction_PgVectoRS,
606
852
  CaseConfigParamInput_Nlist,
607
853
  CaseConfigParamInput_QuantizationType_PgVectoRS,
608
854
  CaseConfigParamInput_QuantizationRatio_PgVectoRS,
855
+ CaseConfigParamInput_max_parallel_workers_PgVectorRS,
609
856
  ]
610
857
 
611
858
  PgVectoRSPerformanceConfig = [
612
- CaseConfigParamInput_IndexType,
613
- CaseConfigParamInput_M,
859
+ CaseConfigParamInput_IndexType_PgVectoRS,
860
+ CaseConfigParamInput_m,
614
861
  CaseConfigParamInput_EFConstruction_PgVectoRS,
862
+ CaseConfigParamInput_EFSearch_PgVectoRS,
615
863
  CaseConfigParamInput_Nlist,
616
864
  CaseConfigParamInput_Nprobe,
617
865
  CaseConfigParamInput_QuantizationType_PgVectoRS,
618
866
  CaseConfigParamInput_QuantizationRatio_PgVectoRS,
867
+ CaseConfigParamInput_max_parallel_workers_PgVectorRS,
619
868
  ]
620
869
 
621
870
  ZillizCloudPerformanceConfig = [
622
871
  CaseConfigParamInput_ZillizLevel,
623
872
  ]
624
873
 
874
+ PgVectorScaleLoadingConfig = [
875
+ CaseConfigParamInput_IndexType_PgVectorScale,
876
+ CaseConfigParamInput_num_neighbors,
877
+ CaseConfigParamInput_storage_layout,
878
+ CaseConfigParamInput_search_list_size,
879
+ CaseConfigParamInput_max_alpha,
880
+ ]
881
+
882
+ PgVectorScalePerformanceConfig = [
883
+ CaseConfigParamInput_IndexType_PgVectorScale,
884
+ CaseConfigParamInput_num_neighbors,
885
+ CaseConfigParamInput_storage_layout,
886
+ CaseConfigParamInput_search_list_size,
887
+ CaseConfigParamInput_max_alpha,
888
+ CaseConfigParamInput_query_rescore,
889
+ CaseConfigParamInput_query_search_list_size,
890
+ ]
891
+
625
892
  CASE_CONFIG_MAP = {
626
893
  DB.Milvus: {
627
894
  CaseLabel.Load: MilvusLoadConfig,
@@ -646,4 +913,8 @@ CASE_CONFIG_MAP = {
646
913
  CaseLabel.Load: PgVectoRSLoadingConfig,
647
914
  CaseLabel.Performance: PgVectoRSPerformanceConfig,
648
915
  },
916
+ DB.PgVectorScale: {
917
+ CaseLabel.Load: PgVectorScaleLoadingConfig,
918
+ CaseLabel.Performance: PgVectorScalePerformanceConfig,
919
+ },
649
920
  }
@@ -46,6 +46,7 @@ DB_TO_ICON = {
46
46
  DB.PgVectoRS: "https://assets.zilliz.com/PG_Vector_d464f2ef5f.png",
47
47
  DB.Redis: "https://assets.zilliz.com/Redis_Cloud_74b8bfef39.png",
48
48
  DB.Chroma: "https://assets.zilliz.com/chroma_ceb3f06ed7.png",
49
+ DB.AWSOpenSearch: "https://assets.zilliz.com/opensearch_1eee37584e.jpeg",
49
50
  }
50
51
 
51
52
  # RedisCloud color: #0D6EFD
@@ -59,4 +60,5 @@ COLOR_MAP = {
59
60
  DB.WeaviateCloud.value: "#20C997",
60
61
  DB.PgVector.value: "#4C779A",
61
62
  DB.Redis.value: "#0D6EFD",
63
+ DB.AWSOpenSearch.value: "#0DCAF0",
62
64
  }
@@ -1,18 +1,14 @@
1
-
2
-
3
-
4
1
  import streamlit as st
5
- from vectordb_bench.backend.cases import CaseType
6
2
  from vectordb_bench.frontend.components.check_results.footer import footer
7
- from vectordb_bench.frontend.components.check_results.expanderStyle import initMainExpanderStyle
8
- from vectordb_bench.frontend.components.check_results.priceTable import priceTable
9
3
  from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
10
- from vectordb_bench.frontend.components.check_results.nav import NavToResults, NavToRunTest
11
- from vectordb_bench.frontend.components.check_results.charts import drawMetricChart
4
+ from vectordb_bench.frontend.components.check_results.nav import (
5
+ NavToResults,
6
+ NavToRunTest,
7
+ )
12
8
  from vectordb_bench.frontend.components.check_results.filters import getshownData
13
9
  from vectordb_bench.frontend.components.concurrent.charts import drawChartsByCase
14
10
  from vectordb_bench.frontend.components.get_results.saveAsImage import getResults
15
- from vectordb_bench.frontend.const.styles import *
11
+ from vectordb_bench.frontend.config.styles import FAVICON
16
12
  from vectordb_bench.interface import benchMarkRunner
17
13
  from vectordb_bench.models import TestResult
18
14
 
@@ -30,26 +26,23 @@ def main():
30
26
  drawHeaderIcon(st)
31
27
 
32
28
  allResults = benchMarkRunner.get_results()
33
-
29
+
34
30
  def check_conc_data(res: TestResult):
35
31
  case_results = res.results
36
32
  count = 0
37
33
  for case_result in case_results:
38
34
  if len(case_result.metrics.conc_num_list) > 0:
39
35
  count += 1
40
-
36
+
41
37
  return count > 0
42
-
38
+
43
39
  checkedResults = [res for res in allResults if check_conc_data(res)]
44
-
45
40
 
46
41
  st.title("VectorDB Benchmark (Concurrent Performance)")
47
42
 
48
43
  # results selector
49
44
  resultSelectorContainer = st.sidebar.container()
50
- shownData, _, showCases = getshownData(
51
- checkedResults, resultSelectorContainer)
52
-
45
+ shownData, _, showCaseNames = getshownData(checkedResults, resultSelectorContainer)
53
46
 
54
47
  resultSelectorContainer.divider()
55
48
 
@@ -61,8 +54,8 @@ def main():
61
54
  # save or share
62
55
  resultesContainer = st.sidebar.container()
63
56
  getResults(resultesContainer, "vectordb_bench_concurrent")
64
-
65
- drawChartsByCase(shownData, showCases, st.container())
57
+
58
+ drawChartsByCase(shownData, showCaseNames, st.container())
66
59
 
67
60
  # footer
68
61
  footer(st.container())
@@ -0,0 +1,64 @@
1
+ import streamlit as st
2
+ from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
3
+ from vectordb_bench.frontend.components.custom.displayCustomCase import displayCustomCase
4
+ from vectordb_bench.frontend.components.custom.displaypPrams import displayParams
5
+ from vectordb_bench.frontend.components.custom.getCustomConfig import CustomCaseConfig, generate_custom_case, get_custom_configs, save_custom_configs
6
+ from vectordb_bench.frontend.components.custom.initStyle import initStyle
7
+ from vectordb_bench.frontend.config.styles import FAVICON, PAGE_TITLE
8
+
9
+
10
+ class CustomCaseManager():
11
+ customCaseItems: list[CustomCaseConfig]
12
+
13
+ def __init__(self):
14
+ self.customCaseItems = get_custom_configs()
15
+
16
+ def addCase(self):
17
+ new_custom_case = generate_custom_case()
18
+ new_custom_case.dataset_config.name = f"{new_custom_case.dataset_config.name} {len(self.customCaseItems)}"
19
+ self.customCaseItems += [new_custom_case]
20
+ self.save()
21
+
22
+ def deleteCase(self, idx: int):
23
+ self.customCaseItems.pop(idx)
24
+ self.save()
25
+
26
+ def save(self):
27
+ save_custom_configs(self.customCaseItems)
28
+
29
+
30
+ def main():
31
+ st.set_page_config(
32
+ page_title=PAGE_TITLE,
33
+ page_icon=FAVICON,
34
+ # layout="wide",
35
+ # initial_sidebar_state="collapsed",
36
+ )
37
+
38
+ # header
39
+ drawHeaderIcon(st)
40
+
41
+ # init style
42
+ initStyle(st)
43
+
44
+ st.title("Custom Dataset")
45
+ displayParams(st)
46
+ customCaseManager = CustomCaseManager()
47
+
48
+ for idx, customCase in enumerate(customCaseManager.customCaseItems):
49
+ expander = st.expander(customCase.dataset_config.name, expanded=True)
50
+ key = f"custom_case_{idx}"
51
+ displayCustomCase(customCase, expander, key=key)
52
+
53
+ columns = expander.columns(8)
54
+ columns[0].button(
55
+ "Save", key=f"{key}_", type="secondary", on_click=lambda: customCaseManager.save())
56
+ columns[1].button(":red[Delete]", key=f"{key}_delete", type="secondary",
57
+ on_click=lambda: customCaseManager.deleteCase(idx))
58
+
59
+ st.button("\+ New Dataset", key=f"add_custom_configs",
60
+ type="primary", on_click=lambda: customCaseManager.addCase())
61
+
62
+
63
+ if __name__ == "__main__":
64
+ main()
@@ -8,7 +8,7 @@ from vectordb_bench.frontend.components.check_results.nav import NavToResults, N
8
8
  from vectordb_bench.frontend.components.check_results.charts import drawMetricChart
9
9
  from vectordb_bench.frontend.components.check_results.filters import getshownData
10
10
  from vectordb_bench.frontend.components.get_results.saveAsImage import getResults
11
- from vectordb_bench.frontend.const.styles import *
11
+ from vectordb_bench.frontend.config.styles import *
12
12
  from vectordb_bench.interface import benchMarkRunner
13
13
  from vectordb_bench.metric import QURIES_PER_DOLLAR_METRIC
14
14
 
@@ -26,7 +26,7 @@ def main():
26
26
 
27
27
  # results selector
28
28
  resultSelectorContainer = st.sidebar.container()
29
- shownData, _, showCases = getshownData(allResults, resultSelectorContainer)
29
+ shownData, _, showCaseNames = getshownData(allResults, resultSelectorContainer)
30
30
 
31
31
  resultSelectorContainer.divider()
32
32
 
@@ -45,8 +45,8 @@ def main():
45
45
  priceMap = priceTable(priceTableContainer, shownData)
46
46
 
47
47
  # charts
48
- for case in showCases:
49
- data = [data for data in shownData if data["case_name"] == case.name]
48
+ for caseName in showCaseNames:
49
+ data = [data for data in shownData if data["case_name"] == caseName]
50
50
  dataWithMetric = []
51
51
  metric = QURIES_PER_DOLLAR_METRIC
52
52
  for d in data:
@@ -56,7 +56,7 @@ def main():
56
56
  d[metric] = d["qps"] / price * 3.6
57
57
  dataWithMetric.append(d)
58
58
  if len(dataWithMetric) > 0:
59
- chartContainer = st.expander(case.name, True)
59
+ chartContainer = st.expander(caseName, True)
60
60
  drawMetricChart(data, metric, chartContainer)
61
61
 
62
62
  # footer
@@ -5,6 +5,7 @@ from vectordb_bench.frontend.components.run_test.dbConfigSetting import dbConfig
5
5
  from vectordb_bench.frontend.components.run_test.dbSelector import dbSelector
6
6
  from vectordb_bench.frontend.components.run_test.generateTasks import generate_tasks
7
7
  from vectordb_bench.frontend.components.run_test.hideSidebar import hideSidebar
8
+ from vectordb_bench.frontend.components.run_test.initStyle import initStyle
8
9
  from vectordb_bench.frontend.components.run_test.submitTask import submitTask
9
10
  from vectordb_bench.frontend.components.check_results.nav import NavToResults
10
11
  from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
@@ -15,6 +16,9 @@ def main():
15
16
  # set page config
16
17
  initRunTestPageConfig(st)
17
18
 
19
+ # init style
20
+ initStyle(st)
21
+
18
22
  # header
19
23
  drawHeaderIcon(st)
20
24