Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cb-util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Alt
cb-util
Commits
55c0b980
Commit
55c0b980
authored
2 years ago
by
Christoph Alt
Browse files
Options
Downloads
Patches
Plain Diff
added plotting functions
parent
15bb5892
Branches
Branches containing commit
No related tags found
1 merge request
!3
Devel/plotting
Pipeline
#50724
failed
2 years ago
Stage: test
Stage: deploy
Stage: trigger
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plotting/roofline.py
+85
-0
85 additions, 0 deletions
plotting/roofline.py
setup.py
+4
-1
4 additions, 1 deletion
setup.py
with
89 additions
and
1 deletion
plotting/roofline.py
0 → 100644
+
85
−
0
View file @
55c0b980
import
plotly.graph_objs
as
go
from
dataclasses
import
dataclass
@dataclass
class
CPUInfo
:
name
:
str
max_perf
:
float
# MFLOP/s
max_band
:
float
# MByte/s
SKYLAKE
=
CPUInfo
(
"
Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
"
,
max_perf
=
5582274.03
,
max_band
=
159321.74
)
DEFAULT_MARKER
=
dict
(
size
=
10
,
color
=
'
green
'
)
def
add_rooflines
(
fig
,
peak_perf
,
max_bw
,
max_x
):
# Calculate maximum flops/byte value
ridge_point
=
peak_perf
/
max_bw
# Add horizontal bandwidth roofline
x_bw
=
[
ridge_point
,
max_x
]
y_bw
=
[
peak_perf
,
peak_perf
]
fig
.
add_trace
(
go
.
Scatter
(
x
=
x_bw
,
y
=
y_bw
,
mode
=
'
lines+text
'
,
name
=
"
Compute Roofline
"
,
text
=
[
f
'
Peak Performance
{
peak_perf
/
1e9
}
GFlop/s
'
,],
textposition
=
"
top right
"
,
line
=
dict
(
color
=
'
blue
'
,
width
=
2
)))
# Add diagonal compute roofline
x_compute
=
[
0
,
ridge_point
]
y_compute
=
[
0
,
peak_perf
]
fig
.
add_trace
(
go
.
Scatter
(
x
=
x_compute
,
y
=
y_compute
,
mode
=
'
lines+text
'
,
name
=
"
Memory Roofline
"
,
text
=
[
""
,
f
"
Memory bandwidth :
{
max_bw
/
1e9
}
GB/s
"
,],
textposition
=
"
bottom left
"
,
line
=
dict
(
color
=
'
green
'
,
width
=
2
)))
return
fig
def
add_data_point
(
fig
,
x
,
y
,
*
,
name
=
""
,
marker
=
DEFAULT_MARKER
,
):
fig
.
add_trace
(
go
.
Scatter
(
x
=
[
x
],
y
=
[
y
],
mode
=
'
markers
'
,
marker
=
marker
,
name
=
name
))
return
fig
def
set_axis
(
fig
):
# Add roofline axes labels
fig
.
update_layout
(
xaxis
=
dict
(
type
=
'
log
'
,
title
=
'
Operational Intensity (Flop/Byte)
'
,
zeroline
=
True
),
yaxis
=
dict
(
type
=
'
log
'
,
title
=
'
Performance (Flop/s)
'
,
zeroline
=
True
)
)
return
fig
def
create_plot
(
peak_perf
,
max_band
):
fig
=
go
.
Figure
()
fig
=
add_rooflines
(
fig
,
peak_perf
,
max_band
,
100
)
fig
=
set_axis
(
fig
)
return
fig
def
add_data_points
(
fig
,
data_points
,
marker
=
DEFAULT_MARKER
):
for
oi
,
perf
,
name
in
data_points
:
fig
=
add_data_point
(
fig
,
oi
,
perf
,
name
=
name
,
marker
=
marker
)
return
fig
This diff is collapsed.
Click to expand it.
setup.py
+
4
−
1
View file @
55c0b980
...
...
@@ -8,13 +8,16 @@ setup(name="cb-util",
author_email
=
"
Christoph.alt@fau.de
"
,
packages
=
find_packages
(
include
=
[
"
cbutil
"
,
"
cbutil.postprocessing
"
,
"
dashboards
"
]),
"
dashboards
"
,
"
plotting
"
]),
install_requires
=
[
"
python-dotenv
"
,
"
influxdb
"
,
"
gitpython
"
,
"
grafanalib
"
,
"
requests
"
,
"
plotly
"
,
"
kaleido
"
,
],
setup_requires
=
[
'
pytest-runner
'
],
tests_require
=
[
'
pytest
'
]
...
...
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