Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Sebastian Bindgen
pystencils
Commits
5fdda96c
Commit
5fdda96c
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Benchmark fixes
parent
0df63c2d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils_tests/benchmark/benchmark.py
+30
-33
30 additions, 33 deletions
pystencils_tests/benchmark/benchmark.py
with
30 additions
and
33 deletions
pystencils_tests/benchmark/benchmark.py
+
30
−
33
View file @
5fdda96c
...
@@ -12,7 +12,7 @@ from pystencils.kerncraft_coupling import KerncraftParameters, PyStencilsKerncra
...
@@ -12,7 +12,7 @@ from pystencils.kerncraft_coupling import KerncraftParameters, PyStencilsKerncra
from
pystencils
import
Field
,
Assignment
,
create_kernel
from
pystencils
import
Field
,
Assignment
,
create_kernel
def
output
B
enchmark
(
analysis
):
def
output
_b
enchmark
(
analysis
):
output
=
{}
output
=
{}
keys
=
[
'
Runtime (per repetition) [s]
'
,
'
Iterations per repetition
'
,
keys
=
[
'
Runtime (per repetition) [s]
'
,
'
Iterations per repetition
'
,
'
Runtime (per cacheline update) [cy/CL]
'
,
'
MEM volume (per repetition) [B]
'
,
'
Runtime (per cacheline update) [cy/CL]
'
,
'
MEM volume (per repetition) [B]
'
,
...
@@ -30,7 +30,7 @@ def outputBenchmark(analysis):
...
@@ -30,7 +30,7 @@ def outputBenchmark(analysis):
return
output
return
output
def
output
ECM
(
analysis
):
def
output
_ecm
(
analysis
):
output
=
{}
output
=
{}
keys
=
[
'
T_nOL
'
,
'
T_OL
'
,
'
cl throughput
'
,
'
uops
'
]
keys
=
[
'
T_nOL
'
,
'
T_OL
'
,
'
cl throughput
'
,
'
uops
'
]
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
...
@@ -47,21 +47,21 @@ def outputECM(analysis):
...
@@ -47,21 +47,21 @@ def outputECM(analysis):
return
output
return
output
def
output
R
oofline
(
analysis
):
def
output
_r
oofline
(
analysis
):
output
=
{}
output
=
{}
keys
=
[
'
min performance
'
]
#
'bottleneck level'
keys
=
[
'
min performance
'
]
#
'bottleneck level'
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
output
.
update
(
copies
)
output
.
update
(
copies
)
# TODO save bottleneck information (compute it here)
# TODO save bottleneck information (compute it here)
#fixed = analysis['max_flops'].with_prefix('G')
#
fixed = analysis['max_flops'].with_prefix('G')
#output['max GFlop/s'] = fixed.value
#
output['max GFlop/s'] = fixed.value
#if analysis['min performance'] > max_flops:
#
if analysis['min performance'] > max_flops:
# # CPU bound
# # CPU bound
# print('CPU bound with {} cores(s)'.format(self._args.cores), file=output_file)
# print('CPU bound with {} cores(s)'.format(self._args.cores), file=output_file)
# print('{!s} due to CPU max. FLOP/s'.format(max_flops), file=output_file)
# print('{!s} due to CPU max. FLOP/s'.format(max_flops), file=output_file)
#else:
#
else:
# Memory bound
# Memory bound
bottleneck
=
analysis
[
'
mem bottlenecks
'
][
analysis
[
'
bottleneck level
'
]]
bottleneck
=
analysis
[
'
mem bottlenecks
'
][
analysis
[
'
bottleneck level
'
]]
output
[
'
bottleneck GFlop/s
'
]
=
bottleneck
[
'
performance
'
].
with_prefix
(
'
G
'
).
value
output
[
'
bottleneck GFlop/s
'
]
=
bottleneck
[
'
performance
'
].
with_prefix
(
'
G
'
).
value
...
@@ -83,21 +83,21 @@ def outputRoofline(analysis):
...
@@ -83,21 +83,21 @@ def outputRoofline(analysis):
return
output
return
output
def
output
R
oofline
IACA
(
analysis
):
def
output
_r
oofline
_iaca
(
analysis
):
output
=
{}
output
=
{}
keys
=
[
'
min performance
'
]
#
'bottleneck level'
keys
=
[
'
min performance
'
]
#
'bottleneck level'
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
copies
=
{
key
:
analysis
[
key
]
for
key
in
keys
}
#output.update(copies)
#
output.update(copies)
# TODO save bottleneck information (compute it here)
# TODO save bottleneck information (compute it here)
#fixed = analysis['max_flops'].with_prefix('G')
#
fixed = analysis['max_flops'].with_prefix('G')
#output['max GFlop/s'] = fixed.value
#
output['max GFlop/s'] = fixed.value
#if analysis['min performance'] > max_flops:
#
if analysis['min performance'] > max_flops:
# # CPU bound
# # CPU bound
# print('CPU bound with {} cores(s)'.format(self._args.cores), file=output_file)
# print('CPU bound with {} cores(s)'.format(self._args.cores), file=output_file)
# print('{!s} due to CPU max. FLOP/s'.format(max_flops), file=output_file)
# print('{!s} due to CPU max. FLOP/s'.format(max_flops), file=output_file)
#else:
#
else:
# Memory bound
# Memory bound
bottleneck
=
analysis
[
'
mem bottlenecks
'
][
analysis
[
'
bottleneck level
'
]]
bottleneck
=
analysis
[
'
mem bottlenecks
'
][
analysis
[
'
bottleneck level
'
]]
output
[
'
bottleneck GFlop/s
'
]
=
bottleneck
[
'
performance
'
].
with_prefix
(
'
G
'
).
value
output
[
'
bottleneck GFlop/s
'
]
=
bottleneck
[
'
performance
'
].
with_prefix
(
'
G
'
).
value
...
@@ -119,7 +119,7 @@ def outputRooflineIACA(analysis):
...
@@ -119,7 +119,7 @@ def outputRooflineIACA(analysis):
return
output
return
output
def
report
A
nalysis
(
ast
,
models
,
machine
,
tags
,
fields
=
None
):
def
report
_a
nalysis
(
ast
,
models
,
machine
,
tags
,
fields
=
None
):
kernel
=
PyStencilsKerncraftKernel
(
ast
,
machine
)
kernel
=
PyStencilsKerncraftKernel
(
ast
,
machine
)
client
=
InfluxDBClient
(
'
i10grafana.informatik.uni-erlangen.de
'
,
8086
,
'
pystencils
'
,
client
=
InfluxDBClient
(
'
i10grafana.informatik.uni-erlangen.de
'
,
8086
,
'
pystencils
'
,
'
roggan
'
,
'
pystencils
'
)
'
roggan
'
,
'
pystencils
'
)
...
@@ -132,13 +132,13 @@ def reportAnalysis(ast, models, machine, tags, fields=None):
...
@@ -132,13 +132,13 @@ def reportAnalysis(ast, models, machine, tags, fields=None):
benchmark
.
analyze
()
benchmark
.
analyze
()
analysis
=
benchmark
.
results
analysis
=
benchmark
.
results
if
model
is
Benchmark
:
if
model
is
Benchmark
:
output
=
output
B
enchmark
(
analysis
)
output
=
output
_b
enchmark
(
analysis
)
elif
model
is
ECM
:
elif
model
is
ECM
:
output
=
output
ECM
(
analysis
)
output
=
output
_ecm
(
analysis
)
elif
model
is
Roofline
:
elif
model
is
Roofline
:
output
=
output
R
oofline
(
analysis
)
output
=
output
_r
oofline
(
analysis
)
elif
model
is
RooflineIACA
:
elif
model
is
RooflineIACA
:
output
=
output
R
oofline
IACA
(
analysis
)
output
=
output
_r
oofline
_iaca
(
analysis
)
else
:
else
:
raise
ValueError
(
'
No valid model for analysis given!
'
)
raise
ValueError
(
'
No valid model for analysis given!
'
)
...
@@ -168,22 +168,19 @@ def main():
...
@@ -168,22 +168,19 @@ def main():
a
[
-
1
,
0
,
0
]
+
a
[
1
,
0
,
0
]
+
\
a
[
-
1
,
0
,
0
]
+
a
[
1
,
0
,
0
]
+
\
a
[
0
,
0
,
-
1
]
+
a
[
0
,
0
,
1
]
a
[
0
,
0
,
-
1
]
+
a
[
0
,
0
,
1
]
update
R
ule
=
Assignment
(
b
[
0
,
0
,
0
],
s
*
rhs
)
update
_r
ule
=
Assignment
(
b
[
0
,
0
,
0
],
s
*
rhs
)
ast
=
create_kernel
([
update
R
ule
])
ast
=
create_kernel
([
update
_r
ule
])
INPUT_FOLDER
=
"
./
"
input_folder
=
"
./
"
machine
F
ile
P
ath
=
os
.
path
.
join
(
INPUT_FOLDER
,
"
SkylakeSP_Gold-5122_allinclusive.yaml
"
)
machine
_f
ile
_p
ath
=
os
.
path
.
join
(
input_folder
,
"
SkylakeSP_Gold-5122_allinclusive.yaml
"
)
machine
=
MachineModel
(
path_to_yaml
=
machine
F
ile
P
ath
)
machine
=
MachineModel
(
path_to_yaml
=
machine
_f
ile
_p
ath
)
tags
=
{
tags
=
{
'
host
'
:
os
.
uname
()[
1
],
'
host
'
:
os
.
uname
()[
1
],
'
project
'
:
'
pystencils
'
,
'
project
'
:
'
pystencils
'
,
'
kernel
'
:
'
jacobi_3D
'
+
str
(
size
)
'
kernel
'
:
'
jacobi_3D
'
+
str
(
size
)
}
}
report
A
nalysis
(
ast
,
[
ECM
,
Roofline
,
RooflineIACA
,
Benchmark
],
machine
,
tags
)
report
_a
nalysis
(
ast
,
[
ECM
,
Roofline
,
RooflineIACA
,
Benchmark
],
machine
,
tags
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
main
()
main
()
while
False
:
main
()
time
.
sleep
(
3600
)
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