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
d6f074b2
Commit
d6f074b2
authored
4 years ago
by
Akash Kothari
Browse files
Options
Downloads
Patches
Plain Diff
Scripts to automate testing of CNN benchmark
parent
2fc4c0c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnn_pred.py
+70
-0
70 additions, 0 deletions
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnn_pred.py
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnns_pred.py
+13
-0
13 additions, 0 deletions
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnns_pred.py
with
83 additions
and
0 deletions
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnn_pred.py
0 → 100644
+
70
−
0
View file @
d6f074b2
import
os.path
from
os
import
path
import
sys
temp_file_name
=
"
temp.txt
"
def
max_num_configs
(
config_file
):
num_configs
=
0
with
open
(
config_file
,
"
r
"
)
as
f
:
for
line
in
f
:
if
"
conf
"
in
line
:
num_configs
=
num_configs
+
1
return
(
num_configs
+
1
)
def
read_and_write_config
(
config_file
,
config_num
,
temp_file
):
config
=
""
with
open
(
config_file
,
"
r
"
)
as
f
:
conf
=
"
conf
"
+
str
(
config_num
)
read_config
=
False
read_first_line
=
False
for
line
in
f
:
if
read_first_line
==
False
:
config
=
config
+
line
read_first_line
=
True
continue
if
"
-----
"
in
line
and
read_config
==
True
:
read_config
=
False
config
=
config
+
line
break
if
read_config
==
True
:
config
=
config
+
line
continue
if
conf
in
line
:
read_config
=
True
config
=
config
+
line
print
(
"
config:
"
)
print
(
config
)
with
open
(
temp_file
,
"
w
"
)
as
f
:
f
.
write
(
config
)
if
__name__
==
"
__main__
"
:
num_args
=
len
(
sys
.
argv
)
binary_files
=
list
()
bench_dir
=
sys
.
argv
[
1
]
print
(
bench_dir
)
arg
=
2
while
arg
<
num_args
:
binary_files
.
append
(
sys
.
argv
[
arg
])
arg
=
arg
+
1
for
dnn_name
in
binary_files
:
binary_dir
=
bench_dir
+
"
/
"
+
dnn_name
pred_dir
=
binary_dir
+
"
/predictive
"
config_file
=
pred_dir
+
"
/
"
+
dnn_name
+
"
.txt
"
temp_file
=
pred_dir
+
"
/
"
+
temp_file_name
print
(
"
binary_dir:
"
+
binary_dir
)
print
(
"
pred_dir:
"
+
pred_dir
)
print
(
"
config_file:
"
+
config_file
)
print
(
"
temp_file:
"
+
temp_file
)
config_num
=
1
max_configs
=
max_num_configs
(
config_file
)
while
config_num
<
max_configs
:
read_and_write_config
(
config_file
,
config_num
,
temp_file
)
exec_command
=
binary_dir
+
"
"
+
temp_file
print
(
exec_command
)
os
.
system
(
exec_command
)
config_num
=
config_num
+
1
This diff is collapsed.
Click to expand it.
llvm/test/VISC/DNN_Benchmarks/benchmarks/run_dnns_pred.py
0 → 100644
+
13
−
0
View file @
d6f074b2
import
os.path
from
os
import
path
#dnns = "alexnet alexnet2 vgg16_cifar10 vgg16_cifar100 resnet18 mobilenet lenet_mnist"
dnns
=
"
alexnet
"
cur_dir
=
"
/home/akashk4/merge/profiling/hpvm/llvm/test/VISC/DNN_Benchmarks/benchmarks
"
if
__name__
==
"
__main__
"
:
exec_command
=
"
python3 run_dnn_pred.py
"
+
"
"
+
cur_dir
+
"
"
+
dnns
print
(
exec_command
)
os
.
system
(
exec_command
)
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