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
6fd2f46a
Commit
6fd2f46a
authored
2 years ago
by
Christoph Alt
Browse files
Options
Downloads
Patches
Plain Diff
reworked the plotting a bit
parent
24b3256d
Branches
Branches containing commit
No related tags found
1 merge request
!3
Devel/plotting
Pipeline
#50752
passed
2 years ago
Stage: test
Stage: deploy
Stage: trigger
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plotting/roofline.py
+44
-31
44 additions, 31 deletions
plotting/roofline.py
with
44 additions
and
31 deletions
plotting/roofline.py
+
44
−
31
View file @
6fd2f46a
...
@@ -16,27 +16,35 @@ SKYLAKE = CPUInfo("Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz",
...
@@ -16,27 +16,35 @@ SKYLAKE = CPUInfo("Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz",
DEFAULT_MARKER
=
dict
(
size
=
10
,
color
=
'
green
'
)
DEFAULT_MARKER
=
dict
(
size
=
10
,
color
=
'
green
'
)
def
add_compute_roofline
(
fig
,
peak_perf
:
float
,
ridge_point
:
float
,
max_x
:
float
):
fig
.
add_trace
(
go
.
Scatter
(
x
=
[
ridge_point
,
max_x
],
y
=
[
peak_perf
,
peak_perf
],
mode
=
'
lines+text
'
,
name
=
f
'
Peak Performance:
{
peak_perf
/
1e9
}
GFlop/s
'
,
textposition
=
"
top right
"
,
line
=
dict
(
color
=
'
blue
'
,
width
=
2
))
)
return
fig
def
add_memory_roofline
(
fig
,
peak_perf
:
float
,
ridge_point
:
float
,
max_bw
:
float
):
fig
.
add_trace
(
go
.
Scatter
(
x
=
[
0
,
ridge_point
],
y
=
[
0
,
peak_perf
],
mode
=
'
lines+text
'
,
name
=
f
"
Maximum Memory bandwidth:
{
max_bw
/
1e9
}
GB/s
"
,
textposition
=
"
bottom left
"
,
line
=
dict
(
color
=
'
green
'
,
width
=
2
))
)
return
fig
def
add_rooflines
(
fig
,
peak_perf
,
max_bw
,
max_x
):
def
add_rooflines
(
fig
,
peak_perf
,
max_bw
,
max_x
):
# Calculate
maximum flops/byte value
# Calculate
oi where oi*max_bw == peak_perf
ridge_point
=
peak_perf
/
max_bw
ridge_point
=
peak_perf
/
max_bw
fig
=
add_compute_roofline
(
fig
,
peak_perf
,
ridge_point
,
max_x
)
# Add horizontal bandwidth roofline
fig
=
add_memory_roofline
(
fig
,
peak_perf
,
ridge_point
,
max_bw
)
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
return
fig
...
@@ -50,32 +58,37 @@ def add_data_point(fig, x, y, *,
...
@@ -50,32 +58,37 @@ def add_data_point(fig, x, y, *,
y
=
[
y
],
y
=
[
y
],
mode
=
'
markers
'
,
mode
=
'
markers
'
,
marker
=
marker
,
marker
=
marker
,
name
=
name
name
=
name
,
text
=
name
,
))
))
return
fig
return
fig
def
set_axis
(
fig
):
def
set_axis
(
fig
):
# Add roofline axes labels
# Add roofline axes labels
common_config
=
dict
(
type
=
'
log
'
,
zeroline
=
True
,
exponentformat
=
"
SI
"
)
fig
.
update_layout
(
fig
.
update_layout
(
xaxis
=
dict
(
xaxis
=
{
type
=
'
log
'
,
'
title
'
:
'
Operational Intensity (Flop/Byte)
'
,
title
=
'
Operational Intensity (Flop/Byte)
'
,
**
common_config
,
zeroline
=
True
},
),
yaxis
=
{
yaxis
=
dict
(
'
title
'
:
'
Performance (Flop/s)
'
,
type
=
'
log
'
,
**
common_config
,
title
=
'
Performance (Flop/s)
'
,
},
zeroline
=
True
)
)
)
return
fig
return
fig
def
create_plot
(
peak_perf
,
max_band
):
def
create_plot
(
peak_perf
,
max_band
,
title
):
fig
=
go
.
Figure
()
fig
=
go
.
Figure
()
fig
=
add_rooflines
(
fig
,
peak_perf
,
max_band
,
100
)
fig
=
add_rooflines
(
fig
,
peak_perf
,
max_band
,
100
)
fig
=
set_axis
(
fig
)
fig
=
set_axis
(
fig
)
fig
.
update_layout
(
title
=
title
)
return
fig
return
fig
...
...
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