Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default values #188

Merged
merged 1 commit into from
Oct 26, 2023
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
12 changes: 6 additions & 6 deletions benchmark/plotting/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def index_size(attrs):


def build_time(attrs):
return attrs.get("build_time", 1e6)
return attrs.get("build_time", -1)


def dist_computations(nq, attrs):
Expand Down Expand Up @@ -144,11 +144,11 @@ def mean_latency(attrs):
"function": lambda true_nn, run_nn, metrics, run_attrs: index_size(run_attrs), # noqa
"worst": float("inf")
},
"queriessize": {
"description": "Index size (kB)/Queries per second (s)",
"function": lambda true_nn, run_nn, metrics, run_attrs: index_size(run_attrs) / queries_per_second(len(true_nn[0]), run_attrs), # noqa
"worst": float("inf")
},
# "queriessize": {
# "description": "Index size (kB)/Queries per second (s)",
# "function": lambda true_nn, run_nn, metrics, run_attrs: index_size(run_attrs) / queries_per_second(len(true_nn[0]), run_attrs), # noqa
# "worst": float("inf")
# },
"wspq": {
"description": "Watt seconds per query (watt*s/query)",
"function": lambda true_nn, run_nn, metrics, run_attrs: watt_seconds_per_query(true_nn, run_attrs),
Expand Down
5 changes: 3 additions & 2 deletions benchmark/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def run(definition, dataset, count, run_count, rebuild,

distance = ds.distance()
search_type = ds.search_type()
build_time = -1 # default value used to indicate that the index was loaded from file
print(f"Running {definition.algorithm} on {dataset}")

custom_runner = RUNNERS.get(neurips23track, BaseRunner)
Expand Down Expand Up @@ -104,8 +105,8 @@ def run(definition, dataset, count, run_count, rebuild,
else:
descriptor, results = custom_runner.run_task(
algo, ds, distance, count, run_count, search_type, private_query)
# A bit unclear how to set this correctly if we usually load from file
#descriptor["build_time"] = build_time

descriptor["build_time"] = build_time
descriptor["index_size"] = index_size
descriptor["algo"] = definition.algorithm
descriptor["dataset"] = dataset
Expand Down
5 changes: 3 additions & 2 deletions data_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ def cleaned_run_metric(run_metrics):
run_metrics = compute_metrics_all_runs(dataset, dataset_name, results, args.recompute, \
args.sensors, args.search_times, args.private_query, \
neurips23track=track, runbook_path=runbook_path)
dfs.append(pd.DataFrame(cleaned_run_metric(run_metrics)))
else:
results = load_all_results(dataset_name, neurips23track=track)
run_metrics = compute_metrics_all_runs(dataset, dataset_name, results, args.recompute, \
args.sensors, args.search_times, args.private_query, neurips23track=track)
dfs.append(pd.DataFrame(cleaned_run_metric(run_metrics)))
results = cleaned_run_metric(run_metrics)
if len(results) > 0:
dfs.append(pd.DataFrame(results))
dfs = [e for e in dfs if len(e) > 0]
if len(dfs) > 0:
data = pd.concat(dfs)
Expand Down
Loading