Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
daab624e
Commit
daab624e
authored
3 years ago
by
Bram Veenboer
Browse files
Options
Downloads
Patches
Plain Diff
COB-121
: Improve readability of tSubbandProcPerformance output
parent
adf568a3
No related branches found
No related tags found
1 merge request
!436
COB-148: Enable NVRTC for CUDA kernel compilation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RTCP/Cobalt/GPUProc/test/SubbandProcs/tSubbandProcPerformance_compare.py
+39
-26
39 additions, 26 deletions
...Proc/test/SubbandProcs/tSubbandProcPerformance_compare.py
with
39 additions
and
26 deletions
RTCP/Cobalt/GPUProc/test/SubbandProcs/tSubbandProcPerformance_compare.py
+
39
−
26
View file @
daab624e
...
@@ -40,8 +40,8 @@ print("Reference: {}".format(filename_reference))
...
@@ -40,8 +40,8 @@ print("Reference: {}".format(filename_reference))
print
(
"
Candidate: {}
"
.
format
(
filename_candidate
))
print
(
"
Candidate: {}
"
.
format
(
filename_candidate
))
print
(
"
Tolerance: {}%
"
.
format
(
tolerance
))
print
(
"
Tolerance: {}%
"
.
format
(
tolerance
))
# Read measurements
def
read_measurements
(
filename
):
def
read_measurements
(
filename
):
# Open results file, skip the first two lines:
# Open results file, skip the first two lines:
# Line 0: date
# Line 0: date
# Line 1: info
# Line 1: info
...
@@ -64,46 +64,57 @@ measurements_candidate = read_measurements(filename_candidate)
...
@@ -64,46 +64,57 @@ measurements_candidate = read_measurements(filename_candidate)
runtime_total
=
measurements_reference
[
"
total
"
]
runtime_total
=
measurements_reference
[
"
total
"
]
runtime_threshold
=
runtime_total
*
0.05
# 5 percent
runtime_threshold
=
runtime_total
*
0.05
# 5 percent
# Check all measurements
# Organize measurements in categories passed, failed and skipped
passed
=
list
()
class
Measurement
():
failed
=
list
()
name
=
""
missing
=
list
()
runtime_reference
=
0.0
status
=
0
runtime_candidate
=
0.0
result
=
0.0
def
__str__
(
self
):
name
=
'
\"
{}
\"
'
.
format
(
self
.
name
)
return
'
{:32}: {:5.2f} -> {:5.2f} ({:5.1f} %)
'
.
format
(
name
,
self
.
runtime_reference
,
self
.
runtime_candidate
,
self
.
result
)
measurements
=
set
()
missing
=
set
()
for
name
,
runtime_reference
in
measurements_reference
.
items
():
for
name
,
runtime_reference
in
measurements_reference
.
items
():
# Skip very short measurements
if
(
name
in
measurements_candidate
):
if
(
runtime_reference
<
runtime_threshold
):
# Skip very short measurements
continue
if
(
runtime_reference
<
runtime_threshold
):
continue
# Try to get runtime for candidate
try
:
# Add measurement entry
runtime_candidate
=
measurements_candidate
[
name
]
measurement
=
Measurement
()
measurement
.
name
=
name
# Compare the two measurements
measurement
.
runtime_reference
=
runtime_reference
performance
=
runtime_candidate
/
runtime_reference
*
100
measurement
.
runtime_candidate
=
measurements_candidate
[
name
]
result
=
"
\"
{}
\"
, reference: {:.2f}, candidate: {:.2f} ({:.1f} %)
"
.
format
(
name
,
runtime_reference
,
runtime_candidate
,
performance
)
measurement
.
result
=
measurement
.
runtime_candidate
/
runtime_reference
*
100
if
(
performance
<
(
100
+
tolerance
)):
measurements
.
add
(
measurement
)
passed
.
append
(
result
)
else
:
else
:
failed
.
append
(
result
)
status
=
1
except
KeyError
:
missing
.
append
(
"
\"
{}
\"
"
.
format
(
name
))
missing
.
append
(
"
\"
{}
\"
"
.
format
(
name
))
status
=
1
status
=
1
passed
=
set
(
filter
(
lambda
measurement
:
measurement
.
result
<
(
100
+
tolerance
),
measurements
))
failed
=
list
(
measurements
-
passed
)
passed
=
list
(
passed
)
passed
=
sorted
(
passed
,
key
=
lambda
m
:
m
.
runtime_reference
,
reverse
=
True
)
failed
=
sorted
(
failed
,
key
=
lambda
m
:
m
.
runtime_reference
,
reverse
=
True
)
# Print summary
# Print summary
print
(
"
>>> Results
"
)
print
(
"
>>> Results
"
)
print
(
"
PASSED:
"
,
end
=
''
)
print
(
"
PASSED:
"
,
end
=
''
)
if
len
(
passed
):
if
len
(
passed
):
print
()
print
()
print
(
"
\n
"
.
join
(
passed
))
print
(
"
\n
"
.
join
(
[
str
(
m
)
for
m
in
passed
]
))
else
:
else
:
print
(
"
none
"
)
print
(
"
none
"
)
print
(
"
FAILED:
"
,
end
=
''
)
print
(
"
FAILED:
"
,
end
=
''
)
if
len
(
failed
):
if
len
(
failed
):
print
()
print
()
print
(
"
\n
"
.
join
(
failed
))
print
(
"
\n
"
.
join
(
[
str
(
m
)
for
m
in
failed
]
))
else
:
else
:
print
(
"
none
"
)
print
(
"
none
"
)
...
@@ -114,4 +125,6 @@ if len(missing):
...
@@ -114,4 +125,6 @@ if len(missing):
else
:
else
:
print
(
"
none
"
)
print
(
"
none
"
)
# Determine exit status and exit
status
=
len
(
failed
)
>
0
or
len
(
missing
)
>
0
exit
(
status
)
exit
(
status
)
\ 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