Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Microbenchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattia Mancini
Microbenchmarks
Commits
9d5dfbff
Commit
9d5dfbff
authored
May 10, 2024
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Create summary plot and metrics
parent
356f1eb6
No related branches found
No related tags found
1 merge request
!3
Add test for matrix
Pipeline
#81468
passed
May 10, 2024
Stage: prepare
Stage: build
Stage: test
Stage: benchmark
Stage: summarize
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
.gitlab-ci.yml
+2
-1
2 additions, 1 deletion
.gitlab-ci.yml
ci/summarize-results.py
+53
-0
53 additions, 0 deletions
ci/summarize-results.py
docker/Dockerfile
+3
-1
3 additions, 1 deletion
docker/Dockerfile
with
59 additions
and
2 deletions
.gitignore
+
1
−
0
View file @
9d5dfbff
.vscode
build
tmp
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
2
−
1
View file @
9d5dfbff
...
...
@@ -88,10 +88,11 @@ performance-generic:
collect-performance
:
stage
:
summarize
image
:
"
$CI_REGISTRY_IMAGE:latest"
dependencies
:
-
performance
artifacts
:
paths
:
-
./results*.json
script
:
-
ls results*.json
\ No newline at end of file
-
python3 ci/summarize-results.py --filter MatrixMultiplication results*.json result-summary
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ci/summarize-results.py
0 → 100644
+
53
−
0
View file @
9d5dfbff
import
json
import
os
from
argparse
import
ArgumentParser
import
seaborn
import
pandas
import
matplotlib.pyplot
as
plt
seaborn
.
set_theme
(
palette
=
"
flare
"
,
style
=
"
whitegrid
"
)
def
parse_args
():
parser
=
ArgumentParser
(
description
=
"
Combine benchmark metrics from Google Benchmarks Framework
"
)
parser
.
add_argument
(
"
files
"
,
nargs
=
"
+
"
,
help
=
"
Metrics
"
)
parser
.
add_argument
(
"
output
"
,
help
=
"
Combined metrics json
"
)
parser
.
add_argument
(
"
--filter
"
,
help
=
"
Filter tests by name
"
)
return
parser
.
parse_args
()
def
read_and_combine_json
(
files
,
filter
):
results
=
[]
for
f_name
in
files
:
basename
=
os
.
path
.
basename
(
f_name
)
with
open
(
f_name
,
'
r
'
)
as
f_stream
:
result_obj
=
json
.
load
(
f_stream
)
results_normalized
=
result_obj
[
"
benchmarks
"
]
for
result_normalized
in
results_normalized
:
if
filter
and
filter
not
in
result_normalized
[
"
name
"
]:
continue
result_normalized
[
"
context
"
]
=
result_obj
[
"
context
"
]
result_normalized
[
"
compiler_version
"
],
result_normalized
[
"
architecture
"
]
=
basename
.
replace
(
"
results-
"
,
""
).
replace
(
"
.json
"
,
""
).
split
(
"
-
"
)
results
.
append
(
result_normalized
)
return
results
def
store_combined
(
outfile
,
obj
):
with
open
(
outfile
+
"
.json
"
,
"
w
"
)
as
f_stream
:
json
.
dump
(
obj
,
f_stream
,
indent
=
4
)
def
create_summary_plot
(
metrics
,
outplot_name
):
time_unit
=
metrics
.
time_unit
[
0
]
grid
=
seaborn
.
FacetGrid
(
metrics
,
col
=
"
architecture
"
)
grid
.
map
(
seaborn
.
barplot
,
"
compiler_version
"
,
"
cpu_time
"
,
"
name
"
)
grid
.
set_ylabels
(
f
"
CPU time(
{
time_unit
}
)
"
)
grid
.
add_legend
()
grid
.
savefig
(
outplot_name
+
"
.png
"
)
def
main
():
args
=
parse_args
()
metrics_results
=
read_and_combine_json
(
args
.
files
,
args
.
filter
)
metrics_dataframe
=
pandas
.
DataFrame
(
metrics_results
)
create_summary_plot
(
metrics_dataframe
,
args
.
output
)
store_combined
(
args
.
output
,
metrics_results
)
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker/Dockerfile
+
3
−
1
View file @
9d5dfbff
...
...
@@ -20,4 +20,6 @@ RUN apt-get update -qq &&\
pkg-config
\
python3-dev python3-numpy
\
python3-sphinx
\
python3-pip
python3-pip
\
python3-seaborn
\
python3-pandas
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment