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
10 changes: 3 additions & 7 deletions engine/clients/redis/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ def init_client(cls, host, distance, connection_params: dict, search_params: dic
# 'EF_RUNTIME' is irrelevant for 'ADHOC_BF' policy
if cls.hybrid_policy != "ADHOC_BF":
cls.knn_conditions = "EF_RUNTIME $EF"
elif cls.algorithm == "SVS":
cls.knn_conditions = "WS_SEARCH $WS_SEARCH"
elif cls.algorithm == "SVS_TIERED":
cls.knn_conditions = "WS_SEARCH $WS_SEARCH"
elif cls.algorithm == "SVS-VAMANA":
cls.knn_conditions = "WS_SEARCH $SEARCH_WINDOW_SIZE"
cls.data_type = "FLOAT32"
if "search_params" in cls.search_params:
cls.data_type = (
Expand Down Expand Up @@ -99,9 +97,7 @@ def search_one(cls, vector, meta_conditions, top) -> List[Tuple[int, float]]:
if cls.hybrid_policy != "ADHOC_BF":
params_dict["EF"] = cls.search_params["search_params"]["ef"]
if cls.algorithm == "SVS":
params_dict["WS_SEARCH"] = cls.search_params["search_params"]["WS_SEARCH"]
if cls.algorithm == "SVS_TIERED":
params_dict["WS_SEARCH"] = cls.search_params["search_params"]["WS_SEARCH"]
params_dict["SEARCH_WINDOW_SIZE"] = cls.search_params["search_params"]["SEARCH_WINDOW_SIZE"]
results = cls._ft.search(q, query_params=params_dict)

return [(int(result.id), float(result.vector_score)) for result in results.docs]
4 changes: 2 additions & 2 deletions engine/clients/redis/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def upload_batch(

@classmethod
def post_upload(cls, _distance):
if cls.algorithm != "HNSW" and cls.algorithm != "FLAT" and cls.algorithm != "SVS" and cls.algorithm != "SVS_TIERED":
if cls.algorithm != "HNSW" and cls.algorithm != "FLAT" and cls.algorithm != "SVS-VAMANA":
print(f"TODO: FIXME!! Avoiding calling ft.info for {cls.algorithm}...")
return {}
index_info = cls.client.ft().info()
Expand Down Expand Up @@ -136,7 +136,7 @@ def get_memory_usage(cls):
used_memory.append(used_memory_shard)
index_info = {}
device_info = {}
if cls.algorithm != "HNSW" and cls.algorithm != "FLAT" and cls.algorithm != "SVS" and cls.algorithm != "SVS_TIERED":
if cls.algorithm != "HNSW" and cls.algorithm != "FLAT" and cls.algorithm != "SVS-VAMANA":
print(f"TODO: FIXME!! Avoiding calling ft.info for {cls.algorithm}...")
else:
index_info = cls.client_decode.ft().info()
Expand Down
10 changes: 5 additions & 5 deletions experiments/configurations/create-svs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
ws_search = [32, 40, 48, 64]
#ws_search = [48]
graph_degree = [32]
#quantization = ["0", "4x4", "4x8", "8", "4"]
quantization = ["8"]
#quantization = ["NO_COMPRESSION", "LVQ4x4", "LVQ4x8", "LVQ4", "LVQ8", "LeanVec4x8", "LeanVec8x8"]
quantization = ["LVQ4x8"]
topKs = [10]
data_types = ["FLOAT32"]

for algo in ["svs_tiered"]:
for algo in ["svs-vamana"]:
for data_type in data_types:
for ws_construct in ws_constructs:
for graph_d in graph_degree:
Expand All @@ -24,7 +24,7 @@
"collection_params": {
"algorithm": algo,
"data_type": data_type,
f"{algo}_config": {"NUM_THREADS": thread, "GRAPH_DEGREE": graph_d, "WS_CONSTRUCTION": ws_construct, "QUANTIZATION": quant},
f"{algo}_config": {"NUM_THREADS": thread, "GRAPH_MAX_DEGREE": graph_d, "CONSTRUCTION_WINDOW_SIZE": ws_construct, "COMPRESSION": quant},
},
"search_params": [],
"upload_params": {
Expand All @@ -40,7 +40,7 @@
"algorithm": algo,
"parallel": client,
"top": top,
"search_params": {"WS_SEARCH": ws_s, "data_type": data_type},
"search_params": {"SEARCH_WINDOW_SIZE": ws_s, "data_type": data_type},
}
config["search_params"].append(test_config)
configs.append(config)
Expand Down