Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
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
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
9e890e90
Commit
9e890e90
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in time/energy storage
parent
6b290187
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
llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
+6
-11
6 additions, 11 deletions
llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
with
6 additions
and
11 deletions
llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
+
6
−
11
View file @
9e890e90
...
@@ -126,13 +126,9 @@ class TableGenerator:
...
@@ -126,13 +126,9 @@ class TableGenerator:
# Don't need to copy the file over --> can use the original file as a reference
# Don't need to copy the file over --> can use the original file as a reference
soc_operations_file
=
open
(
soc_operations_file_name
,
"
r
"
)
soc_operations_file
=
open
(
soc_operations_file_name
,
"
r
"
)
table_file
=
open
(
self
.
__
table_file
name
,
"
w
"
)
table_file
=
open
(
table_file
_path
,
"
w
"
)
# Read header line to get layer name and # operations in layer
# Get ops in each layer using the dict
# TODO possible for operations in the same layer to not have the same # of cols?
# TODO possible for operations in the same layer to not have the same # of cols?
# Need to store a list of all 2nd level dict keys we go through!
# at the very end --> then generate the header and write everything in
curr_line
=
soc_operations_file
.
readline
().
strip
()
curr_line
=
soc_operations_file
.
readline
().
strip
()
...
@@ -140,7 +136,7 @@ class TableGenerator:
...
@@ -140,7 +136,7 @@ class TableGenerator:
# First line is always the layers line (#layer_name,num_ops)
# First line is always the layers line (#layer_name,num_ops)
layer_name
,
num_ops
=
self
.
__parse_layer_info_line
(
curr_line
)
layer_name
,
num_ops
=
self
.
__parse_layer_info_line
(
curr_line
)
print
(
"
FIRST LINE
"
,
layer_name
,
num_ops
)
print
(
"
FIRST LINE
"
,
layer_name
,
num_ops
)
# Get each operation in the layer
# Get each operation in the layer
ops_in_layer
=
[]
ops_in_layer
=
[]
header
=
[
"
**
"
,
layer_name
,
str
(
num_ops
),
"
_
"
]
header
=
[
"
**
"
,
layer_name
,
str
(
num_ops
),
"
_
"
]
...
@@ -154,7 +150,7 @@ class TableGenerator:
...
@@ -154,7 +150,7 @@ class TableGenerator:
# Iterate through time/energy data for each approx type
# Iterate through time/energy data for each approx type
for
approx_type
in
operation_data
:
for
approx_type
in
operation_data
:
curr_op
.
append
(
operation_data
[
approx_type
][
"
time
"
])
curr_op
.
append
(
operation_data
[
approx_type
][
"
time
"
])
curr_op
.
append
(
operation_data
[
approx_type
][
"
time
"
])
curr_op
.
append
(
operation_data
[
approx_type
][
"
energy
"
])
# CRITICAL ASSUMPTION: All ops within a layer have the same # cols
# CRITICAL ASSUMPTION: All ops within a layer have the same # cols
# Only fill out the header once for the layer
# Only fill out the header once for the layer
...
@@ -164,10 +160,9 @@ class TableGenerator:
...
@@ -164,10 +160,9 @@ class TableGenerator:
ops_in_layer
.
append
(
'
'
.
join
(
curr_op
))
ops_in_layer
.
append
(
'
'
.
join
(
curr_op
))
# Getting all operation rows and then writing everything because
# Getting all operation rows and then writing everything because
# calls to write() are slow (memory vs time tradeoff)
# calls to write() are slow (memory vs time tradeoff)
#print("%s" % ' '.join(header))
print
(
"
%s
"
%
'
'
.
join
(
header
))
#print("%s" % '\n'.join(ops_in_layer))
print
(
"
%s
"
%
'
\n
'
.
join
(
ops_in_layer
))
table_file
.
write
(
"
%s
\n
"
%
'
'
.
join
(
header
))
table_file
.
write
(
"
%s
\n
%s
\n
"
%
(
'
'
.
join
(
header
),
'
\n
'
.
join
(
ops_in_layer
)))
table_file
.
write
(
"
%s
\n
"
%
'
\n
'
.
join
(
ops_in_layer
))
curr_line
=
soc_operations_file
.
readline
().
strip
()
curr_line
=
soc_operations_file
.
readline
().
strip
()
...
...
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