Skip to content

Commit 0590e97

Browse files
authored
Dbpedia configuration (#28)
* Add dbpedia calibration json * Add LVQ's to dbpedia-calibration configuration * Fix create-svs * Add LeanVec4X8
1 parent 535054e commit 0590e97

File tree

3 files changed

+339
-15
lines changed

3 files changed

+339
-15
lines changed

engine/clients/redis/search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def init_client(cls, host, distance, connection_params: dict, search_params: dic
3838
if cls.hybrid_policy != "ADHOC_BF":
3939
cls.knn_conditions = "EF_RUNTIME $EF"
4040
elif cls.algorithm == "SVS-VAMANA":
41-
cls.knn_conditions = "WS_SEARCH $SEARCH_WINDOW_SIZE"
41+
cls.knn_conditions = "WS_SEARCH $WS_SEARCH"
4242
cls.data_type = "FLOAT32"
4343
if "search_params" in cls.search_params:
4444
cls.data_type = (
@@ -97,7 +97,7 @@ def search_one(cls, vector, meta_conditions, top) -> List[Tuple[int, float]]:
9797
if cls.hybrid_policy != "ADHOC_BF":
9898
params_dict["EF"] = cls.search_params["search_params"]["ef"]
9999
if cls.algorithm == "SVS-VAMANA":
100-
params_dict["SEARCH_WINDOW_SIZE"] = cls.search_params["search_params"]["SEARCH_WINDOW_SIZE"]
100+
params_dict["WS_SEARCH"] = cls.search_params["search_params"]["WS_SEARCH"]
101101
results = cls._ft.search(q, query_params=params_dict)
102102

103103
return [(int(result.id), float(result.vector_score)) for result in results.docs]
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import json
22

33
threads = [16]
4-
ws_constructs = [100]
5-
ws_search = [32, 40, 48, 64]
4+
ws_constructs = [200]
5+
ws_search = [177]
66
#ws_search = [48]
77
graph_degree = [32]
8-
#quantization = ["NO_COMPRESSION", "LVQ4x4", "LVQ4x8", "LVQ4", "LVQ8", "LeanVec4x8", "LeanVec8x8"]
9-
quantization = ["LVQ4x8"]
10-
topKs = [10]
11-
data_types = ["FLOAT32"]
8+
#quantization = ["LVQ4X4", "LVQ4x8", "LVQ8", "LVQ4"]
9+
quantization = ["LVQ4X4"]
10+
topKs = [100]
11+
data_types = ["FLOAT16", "FLOAT32"]
1212

1313
for algo in ["svs-vamana"]:
1414
for data_type in data_types:
@@ -18,34 +18,34 @@
1818
configs = []
1919
for thread in threads:
2020
config = {
21-
"name": f"svs-test-algo-{algo}-graph-{graph_d}-ws-con-{ws_construct}-quant-{quant}-threads-{thread}-dt-{data_type}",
21+
"name": f"svs-{algo}-quant-{quant}-dt-{data_type}",
2222
"engine": "redis",
2323
"connection_params": {},
2424
"collection_params": {
2525
"algorithm": algo,
2626
"data_type": data_type,
27-
f"{algo}_config": {"NUM_THREADS": thread, "GRAPH_MAX_DEGREE": graph_d, "CONSTRUCTION_WINDOW_SIZE": ws_construct, "COMPRESSION": quant},
27+
f"{algo}_config": {"NUM_THREADS": thread, "GRAPH_MAX_DEGREE": graph_d, "CONSTRUCTION_WINDOW_SIZE": ws_construct, "compression": quant},
2828
},
2929
"search_params": [],
3030
"upload_params": {
31-
"parallel": 128,
31+
"parallel": 100,
3232
"data_type": data_type,
3333
"algorithm": algo,
3434
},
3535
}
36-
for client in [1, 8, 16, 32, 64, 128]:
36+
for client in [100]:
3737
for ws_s in ws_search:
3838
for top in topKs:
3939
test_config = {
4040
"algorithm": algo,
4141
"parallel": client,
4242
"top": top,
43-
"search_params": {"SEARCH_WINDOW_SIZE": ws_s, "data_type": data_type},
43+
"search_params": {"WS_SEARCH": ws_s, "data_type": data_type},
4444
}
4545
config["search_params"].append(test_config)
4646
configs.append(config)
4747

48-
fname = f"svs-test-algo-{algo}-graph-{graph_d}-ws-con-{ws_construct}-quant-{quant}-threads-{thread}-dt-{data_type}.json"
48+
fname = f"svs-{algo}-quant-{quant}-dt-{data_type}.json"
4949
with open(fname, "w") as json_fd:
5050
json.dump(configs, json_fd, indent=2)
51-
print(f"Created {len(configs)} configs for {fname}.")
51+
print(f"Created {len(configs)} configs for {fname}.")

0 commit comments

Comments
 (0)