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
dbe81220
Commit
dbe81220
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Added time/energy labels for headers and fixed quantization data to be at the end
parent
3727ea6f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+43
-9
43 additions, 9 deletions
llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
with
43 additions
and
9 deletions
llvm/projects/hpvm-tensor-rt/build_pldi/table_generator.py
+
43
−
9
View file @
dbe81220
...
@@ -139,7 +139,7 @@ class TableGenerator:
...
@@ -139,7 +139,7 @@ class TableGenerator:
# 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
)]
for
op_in_layer_count
in
range
(
num_ops
):
for
op_in_layer_count
in
range
(
num_ops
):
# Each line consists of operation name
# Each line consists of operation name
...
@@ -147,17 +147,51 @@ class TableGenerator:
...
@@ -147,17 +147,51 @@ class TableGenerator:
curr_op
=
[
curr_line
]
# Join into a string later
curr_op
=
[
curr_line
]
# Join into a string later
operation_data
=
self
.
__table
[
curr_line
]
operation_data
=
self
.
__table
[
curr_line
]
h2f_data
=
[
None
]
*
2
f2h_data
=
[
None
]
*
2
has_h2f_field
=
False
has_f2h_field
=
False
# 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
"
])
op_time
=
operation_data
[
approx_type
][
"
time
"
]
curr_op
.
append
(
operation_data
[
approx_type
][
"
energy
"
])
op_energy
=
operation_data
[
approx_type
][
"
energy
"
]
# CRITICAL ASSUMPTION: All ops within a layer have the same # cols
if
approx_type
==
"
h2f
"
:
# Only fill out the header once for the layer
h2f_data
[
0
]
=
op_time
if
op_in_layer_count
==
0
:
h2f_data
[
1
]
=
op_energy
header
.
append
(
approx_type
)
has_h2f_field
=
True
elif
approx_type
==
"
f2h
"
:
f2h_data
[
0
]
=
op_time
f2h_data
[
1
]
=
op_energy
has_f2h_field
=
True
else
:
curr_op
.
append
(
op_time
)
curr_op
.
append
(
op_energy
)
# CRITICAL ASSUMPTION: All ops within a layer have the same # cols
# Only fill out the header once for the layer
if
op_in_layer_count
==
0
:
header
.
append
(
"
%s_time
"
%
approx_type
)
header
.
append
(
"
%s_energy
"
%
approx_type
)
# Guarantee that the quantization data is at the end of the col
# TODO: How essential is this bc it increases the complexity of my code
if
has_h2f_field
:
curr_op
.
append
(
'
'
.
join
(
h2f_data
))
if
has_f2h_field
:
curr_op
.
append
(
'
'
.
join
(
f2h_data
))
ops_in_layer
.
append
(
'
'
.
join
(
curr_op
))
ops_in_layer
.
append
(
'
'
.
join
(
curr_op
))
# update header with h2f/f2h cols if they exist
if
has_h2f_field
:
header
.
append
(
"
h2f_time
"
)
header
.
append
(
"
h2f_energy
"
)
if
has_f2h_field
:
header
.
append
(
"
f2h_time
"
)
header
.
append
(
"
f2h_energy
"
)
# 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
))
...
...
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