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
e52cd166
Commit
e52cd166
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug inn generating output files
parent
18224f2d
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_new_config_fp16_repl.py
+10
-12
10 additions, 12 deletions
...projects/soc_simulator/src/driver_new_config_fp16_repl.py
with
10 additions
and
12 deletions
llvm/projects/soc_simulator/src/driver_new_config_fp16_repl.py
+
10
−
12
View file @
e52cd166
...
@@ -227,16 +227,13 @@ class Driver:
...
@@ -227,16 +227,13 @@ class Driver:
curr_layer
=
Driver
.
PrecisionTypes
.
FP16
curr_layer
=
Driver
.
PrecisionTypes
.
FP16
elif
line
.
find
(
"
fp32
"
)
!=
-
1
:
elif
line
.
find
(
"
fp32
"
)
!=
-
1
:
curr_layer
=
Driver
.
PrecisionTypes
.
FP32
curr_layer
=
Driver
.
PrecisionTypes
.
FP32
if
precision_type
==
"
perf
"
or
precision_type
==
"
samp
"
:
# Handle approx type
if
precision_type
==
"
perf
"
or
precision_type
==
"
samp
"
:
# Handle approx type
if
precision_type
==
"
perf
"
:
if
precision_type
==
"
perf
"
:
approx_type
=
Driver
.
ApproxTypes
.
PERF
approx_type
=
Driver
.
ApproxTypes
.
PERF
elif
precision_type
==
"
samp
"
:
elif
precision_type
==
"
samp
"
:
approx_type
=
Driver
.
ApproxTypes
.
SAMP
approx_type
=
Driver
.
ApproxTypes
.
SAMP
if
line
.
find
(
"
fp16
"
)
!=
-
1
:
curr_layer
=
Driver
.
PrecisionTypes
.
FP16
curr_layer
=
Driver
.
PrecisionTypes
.
FP16
print
(
curr_layer
,
prev_layer
)
elif
line
.
find
(
"
fp32
"
)
!=
-
1
:
curr_layer
=
Driver
.
PrecisionTypes
.
FP32
quant_time
,
quant_energy
=
self
.
__quantize
(
precision_type
,
op_number
,
curr_layer
,
prev_layer
,
tensor_count
,
layer_table_data
)
quant_time
,
quant_energy
=
self
.
__quantize
(
precision_type
,
op_number
,
curr_layer
,
prev_layer
,
tensor_count
,
layer_table_data
)
if
quant_time
!=
0
:
if
quant_time
!=
0
:
assert
i
==
2
#and layer_ind == 0
assert
i
==
2
#and layer_ind == 0
...
@@ -280,7 +277,6 @@ class Driver:
...
@@ -280,7 +277,6 @@ class Driver:
prev_layer
=
curr_layer
prev_layer
=
curr_layer
self
.
fp16_baseline
.
append
((
hardware
,
fp16_layer
))
self
.
fp16_baseline
.
append
((
hardware
,
fp16_layer
))
#print(self.fp16_baseline)
self
.
__conf_results
.
append
(
(
first_line
,
curr_conf_results
)
)
self
.
__conf_results
.
append
(
(
first_line
,
curr_conf_results
)
)
line
=
config_file
.
readline
().
strip
()
line
=
config_file
.
readline
().
strip
()
config_file
.
close
()
config_file
.
close
()
...
@@ -306,6 +302,7 @@ class Driver:
...
@@ -306,6 +302,7 @@ class Driver:
else
:
else
:
lookup_key
=
"
_
"
+
precision_type
+
str
(
op_number
)
+
"
_
"
lookup_key
=
"
_
"
+
precision_type
+
str
(
op_number
)
+
"
_
"
print
(
curr_layer
)
if
curr_layer
==
Driver
.
PrecisionTypes
.
FP32
:
if
curr_layer
==
Driver
.
PrecisionTypes
.
FP32
:
time_key
=
"
h2f%stime
"
%
lookup_key
time_key
=
"
h2f%stime
"
%
lookup_key
energy_key
=
"
h2f%senergy
"
%
lookup_key
energy_key
=
"
h2f%senergy
"
%
lookup_key
...
@@ -314,8 +311,8 @@ class Driver:
...
@@ -314,8 +311,8 @@ class Driver:
energy_key
=
"
f2h%senergy
"
%
lookup_key
energy_key
=
"
f2h%senergy
"
%
lookup_key
time
=
tensor_op_row
[
time_key
]
time
=
tensor_op_row
[
time_key
]
energy
=
tensor_op_row
[
energy_key
]
energy
=
tensor_op_row
[
energy_key
]
#
print(time_key, energy_key)
print
(
time_key
,
energy_key
)
#
print("Quantization: (%f, %f)" % (time, energy))
print
(
"
Quantization: (%f, %f)
"
%
(
time
,
energy
))
return
(
time
,
energy
)
return
(
time
,
energy
)
...
@@ -440,6 +437,7 @@ class Driver:
...
@@ -440,6 +437,7 @@ class Driver:
for
tensor_ind
,
(
op_time
,
op_energy
,
tensor_op
)
in
enumerate
(
layer
):
for
tensor_ind
,
(
op_time
,
op_energy
,
tensor_op
)
in
enumerate
(
layer
):
if
tensor_op
.
find
(
"
softmax
"
)
!=
-
1
:
if
tensor_op
.
find
(
"
softmax
"
)
!=
-
1
:
final_conf_layer
.
append
((
None
,
None
,
tensor_op
))
continue
continue
# layer name, operation name, val name
# layer name, operation name, val name
baseline_time
=
self
.
fp16_baseline
[
layer_ind
][
1
][
tensor_ind
][
0
]
baseline_time
=
self
.
fp16_baseline
[
layer_ind
][
1
][
tensor_ind
][
0
]
...
@@ -450,10 +448,10 @@ class Driver:
...
@@ -450,10 +448,10 @@ class Driver:
final_tensor_op
=
tensor_op
final_tensor_op
=
tensor_op
#print(op_time > baseline_time)
#print(op_time > baseline_time)
if
op_time
>
baseline_time
:
if
op_time
>
baseline_time
:
print
(
"
**************** BIGGER ******************
"
)
#
print("**************** BIGGER ******************")
print
(
curr_conf_name
)
#
print(curr_conf_name)
print
(
baseline_time
,
baseline_energy
,
baseline_op
,
layer_ind
)
#
print(baseline_time, baseline_energy, baseline_op, layer_ind)
print
(
op_time
,
tensor_op
,
layer_ind
)
#
print(op_time, tensor_op, layer_ind)
final_time
+=
baseline_time
final_time
+=
baseline_time
final_energy
+=
baseline_energy
final_energy
+=
baseline_energy
final_tensor_op
=
baseline_op
final_tensor_op
=
baseline_op
...
...
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