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
bd1f0938
Commit
bd1f0938
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in total time/energy storag
parent
8a14cb9f
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/soc_simulator/src/driver.py
+6
-9
6 additions, 9 deletions
llvm/projects/soc_simulator/src/driver.py
with
6 additions
and
9 deletions
llvm/projects/soc_simulator/src/driver.py
+
6
−
9
View file @
bd1f0938
...
...
@@ -202,7 +202,7 @@ def run_simulations(config_filename):
exit
(
1
)
config_file
=
open
(
config_filename
,
"
r
"
)
# each line = indepedent configuration
# layers are separated by commas
# tensor ops are separated by spaces
...
...
@@ -211,9 +211,6 @@ def run_simulations(config_filename):
prev_layer
=
ApproxTypes
.
FP32
curr_layer
=
None
aggregate_results
[
results_time_key
][
config_count
]
=
0
aggregate_results
[
results_energy_key
][
config_count
]
=
0
for
layer_ind
,
config_layer
in
enumerate
(
config_layers
):
# level
layer_data
=
tensor_layers
[
layer_ind
]
# layer
layer_name
=
layer_data
[
"
Name
"
]
...
...
@@ -224,9 +221,9 @@ def run_simulations(config_filename):
quant_time
,
quant_energy
=
quantize
(
curr_layer
,
prev_layer
,
0
,
layer_data
)
# Compute
time
,
energy
=
run_promise_simulation
(
config_layer
,
layer_data
)
print
(
time
,
energy
)
aggregate_results
[
results_time_key
][
config_count
]
+=
time
aggregate_results
[
results_energy_key
][
config_count
]
+=
energy
else
:
print
(
"
Running layer %s on the GPU
"
%
layer_name
)
tensor_ops
=
config_layer
.
split
(
'
'
)
...
...
@@ -241,17 +238,16 @@ def run_simulations(config_filename):
curr_layer
=
ApproxTypes
.
FP32
quant_time
,
quant_energy
=
quantize
(
curr_layer
,
prev_layer
,
tensor_ind
,
\
layer_data
)
conv_time
,
conv_energy
=
run_gpu_simulation
(
curr_layer
,
layer_name
,
tensor_ind
)
total_time
+=
conv_time
total_
time
+
=
conv_energy
total_time
+=
quant_time
+
conv_time
total_
energy
+=
quant_energy
+
conv_energy
aggregate_results
[
results_time_key
][
config_count
]
+=
total_time
aggregate_results
[
results_energy_key
][
config_count
]
+=
total_energy
prev_layer
=
curr_layer
config_count
+=
1
print
(
"
\n
"
)
config_count
+=
1
# because we're storing the count and not the index
config_file
.
close
()
...
...
@@ -267,6 +263,7 @@ def display_results(results_filename):
attribute_data
.
append
(
"
Configuration,Total,Improvement
"
)
# header
baseline_val
=
aggregate_results
[
attribute
][
0
]
print
(
baseline_val
)
best_config
=
None
best_result
=
None
...
...
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