Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kdtree
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cython-plus
kdtree
Commits
c11a22f3
Commit
c11a22f3
authored
Nov 02, 2021
by
Julien Jerphanion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify benchmark analysis
parent
4254a348
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
815 deletions
+68
-815
Makefile
Makefile
+1
-1
benchmarks/analysis.ipynb
benchmarks/analysis.ipynb
+52
-802
benchmarks/benchmark.py
benchmarks/benchmark.py
+10
-10
benchmarks/report.py
benchmarks/report.py
+3
-1
environment.yml
environment.yml
+2
-1
No files found.
Makefile
View file @
c11a22f3
SHELL
=
/bin/bash
PROJECT
=
cython+
PROJECT
=
kdtree
VENV_PATH
=
`
conda info
--base
`
/envs/
${PROJECT}
PIP_EXECUTABLE
=
${VENV_PATH}
/bin/pip
...
...
benchmarks/analysis.ipynb
View file @
c11a22f3
This diff is collapsed.
Click to expand it.
benchmarks/benchmark.py
View file @
c11a22f3
...
...
@@ -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
}
"
)
benchmarks/report.py
View file @
c11a22f3
...
...
@@ -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."
)
environment.yml
View file @
c11a22f3
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment