Commit c11a22f3 authored by Julien Jerphanion's avatar Julien Jerphanion

Simplify benchmark analysis

parent 4254a348
SHELL = /bin/bash
PROJECT = cython+
PROJECT = kdtree
VENV_PATH=`conda info --base`/envs/${PROJECT}
PIP_EXECUTABLE=${VENV_PATH}/bin/pip
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ def benchmark(config, results_folder, bench_name):
one_GiB = 1e9
benchmarks = pd.DataFrame()
n_threads = _openmp_effective_n_threads()
n_threads = int(_openmp_effective_n_threads())
env_specs_file = f"{results_folder}/{bench_name}.json"
......@@ -112,21 +112,21 @@ def benchmark(config, results_folder, bench_name):
benchmarks = benchmarks.append(row, ignore_index=True)
pprint(row)
print("---")
print("---")
benchmarks.to_csv(
f"{results_folder}/{bench_name}.csv",
mode="w+",
index=False,
)
for k in n_neighbors:
t0_ = time.perf_counter()
sk_tree.query(X_test, k=k, return_distance=False)
t1_ = time.perf_counter()
time_elapsed = round(t1_ - t0_, 5)
row = dict(
trial=trial,
func="query",
......@@ -143,8 +143,8 @@ def benchmark(config, results_folder, bench_name):
benchmarks = benchmarks.append(row, ignore_index=True)
pprint(row)
print("---")
closests = np.zeros((ns_test, k), dtype=np.int32)
closests = np.zeros((ns_test, k), dtype=np.int32)
t0_ = time.perf_counter()
tree.query(X_test, closests)
t1_ = time.perf_counter()
......@@ -165,7 +165,7 @@ def benchmark(config, results_folder, bench_name):
benchmarks = benchmarks.append(row, ignore_index=True)
pprint(row)
print("---")
print("---")
benchmarks.to_csv(
f"{results_folder}/{bench_name}.csv",
......@@ -173,7 +173,7 @@ def benchmark(config, results_folder, bench_name):
index=False,
)
# Overriding again now that all the dyn. lib. have been loaded
env_specs["threadpool_info"] = threadpoolctl.threadpool_info()
......@@ -198,4 +198,4 @@ if __name__ == "__main__":
print(f"Benchmarking {bench_name}")
benchmark(config, results_folder, bench_name)
print(f"Benchmark results wrote in {results_folder}")
\ No newline at end of file
print(f"Benchmark results wrote in {results_folder}")
......@@ -77,4 +77,6 @@ if __name__ == "__main__":
% vals
)
_ = fig.suptitle(title, fontsize=16)
plt.savefig(f"{commit_result_folder}/{i}.pdf", bbox_inches="tight")
fig_file = f"{commit_result_folder}/{i}.pdf"
plt.savefig(fig_file, bbox_inches="tight")
print(f"{fig_file} written.")
name: cython+
name: kdtree
channels:
- conda-forge
dependencies:
......@@ -15,6 +15,7 @@ dependencies:
- pytest
- scikit-learn
- memory_profiler
- pip
- pip:
# Install cython+ from upstream directly
- -e git+https://lab.nexedi.com/nexedi/cython.git@b30eafec6a7b174afdc4f023b45b21f85104e2fe#egg=Cython
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment