Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
watcag-public
fpga-syspart
Commits
6a554713
Commit
6a554713
authored
Nov 04, 2019
by
LongChan
Browse files
Fixing scrip's path
parent
e092c33a
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
181 additions
and
20 deletions
+181
-20
README.md
README.md
+29
-2
optimization_algo/approaches/brute_force_approach.py
optimization_algo/approaches/brute_force_approach.py
+2
-1
optimization_algo/approaches/cma_approach.py
optimization_algo/approaches/cma_approach.py
+4
-4
optimization_algo/resulting_csv/cma.csv
optimization_algo/resulting_csv/cma.csv
+133
-0
optimization_algo/scripts/brute_force_parallel.sh
optimization_algo/scripts/brute_force_parallel.sh
+2
-2
optimization_algo/scripts/sweep_nets_brute.sh
optimization_algo/scripts/sweep_nets_brute.sh
+1
-1
optimization_algo/scripts/sweep_nets_cma.sh
optimization_algo/scripts/sweep_nets_cma.sh
+10
-10
No files found.
README.md
View file @
6a554713
...
...
@@ -16,9 +16,36 @@ We provide a fast optimization algorithm and a step-to-step guide on how to gene
-
[] Changes done to ScaleSim
-
[] Explanation of the testing result
### Demos:
### Demos
The following demos use pre-generated datasets and topologies that can be found in:
### Step-by-step guide:
-
[
~/optimization_algo/topologies
](
~/optimization_algo/topologies/
)
contains all the topologies descriping their respective CNN structures
-
[
~/optimization_algo/data_source
](
~/optimization_algo/data_source/
)
contains all the cycle-accurate data generated using
[
SCALE sim
](
)
The instruction below will do a sweep run on each of the following networks:
-
FasterRCNN
-
Mobilenet
-
Yolo tiny
-
Googlenet
-
Alexnet
-
AlphaGoZero
-
NCF_rec
-
Resnet_50_v1
To run individual
To get optimization result with
1.
CMA
```
bash
# cd optimization_algo/scripts
# ./sweep_nets_cma.sh
```
2.
Brute Force
```
bash
# cd optimization_algo/scripts
# ./sweep_nets_.sh
```
#### Custom topologies
#### Custom target board
...
...
optimization_algo/approaches/brute_force_approach.py
View file @
6a554713
import
sys
import
time
import
csv
import
path_constant
as
pc
from
tqdm
import
tqdm
from
itertools
import
combinations
...
...
@@ -172,7 +173,7 @@ if __name__ == "__main__":
number_of_partition
=
k
,
max_res_available
=
max_res_unit
,
initial_res
=
0
,
res_step
=
1
,
res_step
=
1
)
# bf.generate_gene()
...
...
optimization_algo/approaches/cma_approach.py
View file @
6a554713
...
...
@@ -49,7 +49,7 @@ class cma_approach(object):
def
parse_topology_file
(
self
):
layers
=
[]
with
open
(
self
.
topology_file
,
'r'
)
as
f
:
with
open
(
pc
.
TOPOLOGIES_PATH
+
self
.
topology_file
,
'r'
)
as
f
:
next
(
f
)
for
line
in
f
:
elems
=
line
.
strip
().
split
(
','
)
...
...
@@ -62,7 +62,7 @@ class cma_approach(object):
def
parse_data_set_file
(
self
,
path_to_data_csv
):
first
=
True
target_idx
=
2
with
open
(
path_to_data_csv
,
'r'
)
as
f
:
with
open
(
pc
.
DATA_SOURCE_PATH
+
path_to_data_csv
,
'r'
)
as
f
:
for
line
in
f
:
elems
=
line
.
strip
().
split
(
','
)
# print(elems)
...
...
@@ -378,8 +378,8 @@ if __name__ == "__main__":
target_col
=
sys
.
argv
[
6
]
es_hybird
=
cma_approach
(
path_to_datasrc
=
pc
.
DATA_SOURCE_PATH
+
str
(
topology
)
+
"_mem_bound.csv"
,
path_to_topology
=
pc
.
TOPOLOGIES_PATH
+
str
(
topology
)
+
".csv"
,
path_to_datasrc
=
str
(
topology
)
+
"_mem_bound.csv"
,
path_to_topology
=
str
(
topology
)
+
".csv"
,
target_col
=
str
(
target_col
),
number_of_partition
=
k
,
max_iteration
=
10000
,
...
...
optimization_algo/resulting_csv/cma.csv
View file @
6a554713
This diff is collapsed.
Click to expand it.
optimization_algo/scripts/brute_force_parallel.sh
View file @
6a554713
...
...
@@ -10,13 +10,13 @@ do
for
res_unit
in
960
;
do
for
target
in
DRAM_cycle
;
do
do
echo
$net
$partitions
$target
python3 brute_force_approach.py
\
${
net
}
\
${
partitions
}
\
${
res_unit
}
\
${
target
}
done
done
done
done
\ No newline at end of file
optimization_algo/scripts/sweep_nets_brute.sh
View file @
6a554713
...
...
@@ -14,7 +14,7 @@ do
for
target
in
DRAM_cycle
;
do
echo
$net
$partitions
$target
python3 brute_force_approach.py
\
python3
../approaches/
brute_force_approach.py
\
${
net
}
\
${
partitions
}
\
${
res_unit
}
\
...
...
optimization_algo/scripts/sweep_nets_cma.sh
View file @
6a554713
...
...
@@ -24,16 +24,16 @@ do
for
res_unit
in
960
;
do
for
target
in
DRAM_cycle Cycles
;
do
echo
$net
$partitions
$strategy
python3 ../approaches/cma_approach.py
\
${
net
}
\
${
partitions
}
\
${
popsize
}
\
${
res_unit
}
\
${
strategy
}
\
${
target
}
done
do
echo
$net
$partitions
$strategy
python3 ../approaches/cma_approach.py
\
${
net
}
\
${
partitions
}
\
${
popsize
}
\
${
res_unit
}
\
${
strategy
}
\
${
target
}
done
done
done
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment