README.md 3.77 KB
Newer Older
Long Chung Chan's avatar
Long Chung Chan committed
1
2
# Partitioning FPGA-Optimized Systolic Arrays

LongChan's avatar
LongChan committed
3
We provide a fast optimization algorithm and a step-to-step guide on how to generate the dataset for a specific board and topologies to be used by our optimization tool.
Long Chung Chan's avatar
Long Chung Chan committed
4
5

>    *Long Chung Chan, Gurshaant Singh Malik and Nachiket Kapre*
Harry Chan's avatar
Harry Chan committed
6
7
8

>    [**"Partitioning FPGA-Optimized Systolic Arrays for Fun and Profit"**](https://git.uwaterloo.ca/watcag-public/fpga-syspart/blob/master/optimization_algo/paper/PID6211513.pdf)

Long Chung Chan's avatar
Long Chung Chan committed
9
10
>    2019 International Conference on Field-Programmable Technology 

Harry Chan's avatar
Harry Chan committed
11
## TODO
Harry Chan's avatar
Harry Chan committed
12
13
- [x] Add a public link to the paper
- [x] Basic Demo Flow
Long Chung Chan's avatar
Long Chung Chan committed
14
15
16
17
18
19
20
- [] Step-by-step guide on
  - [] their own data set
  - [] running the optimzation algo on the generated dataset
- [] What each files/directories are responsible for
- [] Changes done to ScaleSim
- [] Explanation of the testing result

Harry Chan's avatar
Harry Chan committed
21
## Demo
LongChan's avatar
LongChan committed
22
The following demos use pre-generated datasets and topologies that can be found in:
Long Chung Chan's avatar
Long Chung Chan committed
23

Harry Chan's avatar
Harry Chan committed
24
25
- [topologies](https://git.uwaterloo.ca/watcag-public/fpga-syspart/blob/master/optimization_algo/topologies/) contains all the topologies descriping their respective CNN structures
- [data_source](https://git.uwaterloo.ca/watcag-public/fpga-syspart/blob/master/optimization_algo/data_source/) contains all the cycle-accurate data generated using [SCALE sim](https://github.com/ARM-software/SCALE-Sim)
LongChan's avatar
LongChan committed
26
27
28
29
30
31
32
33
34
35
36

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

LongChan's avatar
LongChan committed
37
To obtain individual optimization result for a specific network and a specfic number of partition, please refer to the section below.
LongChan's avatar
LongChan committed
38

Harry Chan's avatar
Harry Chan committed
39
To get optimization result with:
LongChan's avatar
LongChan committed
40
1. Covariance Matrix Adaptation Evolution Strategy (CMA-es)
LongChan's avatar
LongChan committed
41
42
43
44
45
    ```bash
    # cd optimization_algo/scripts
    # ./sweep_nets_cma.sh
    ```

LongChan's avatar
LongChan committed
46
2. Genetic Algorithm (GA)
LongChan's avatar
LongChan committed
47
48
    ```bash
    # cd optimization_algo/scripts
LongChan's avatar
LongChan committed
49
    # ./sweep_nets_ga.sh
LongChan's avatar
LongChan committed
50
51
    ```

LongChan's avatar
LongChan committed
52
3. Hyperparameter Optimiztion
LongChan's avatar
LongChan committed
53
54
    ```bash
    # cd optimization_algo/scripts
LongChan's avatar
LongChan committed
55
    # ./sweep_nets_ho.sh
LongChan's avatar
LongChan committed
56
57
    ```

LongChan's avatar
LongChan committed
58
4. Brute Force
LongChan's avatar
LongChan committed
59
60
    ```bash
    # cd optimization_algo/scripts
LongChan's avatar
LongChan committed
61
    # ./sweep_nets_brute.sh
LongChan's avatar
LongChan committed
62
    ```
Long Chung Chan's avatar
Long Chung Chan committed
63

Harry Chan's avatar
Harry Chan committed
64
65
Result of the optimization will be added to the corresponding csv file under this [folder](https://git.uwaterloo.ca/watcag-public/fpga-syspart/blob/master/optimization_algo/resulting_csv)

Harry Chan's avatar
Harry Chan committed
66
## Step-by-step detail guide
LongChan's avatar
LongChan committed
67

Harry Chan's avatar
Harry Chan committed
68
### Custom topologies
Harry Chan's avatar
Harry Chan committed
69

Harry Chan's avatar
Harry Chan committed
70
### Custom target board
Harry Chan's avatar
Harry Chan committed
71

Harry Chan's avatar
Harry Chan committed
72
### Generate data source using SCALE-sim
Long Chung Chan's avatar
Long Chung Chan committed
73

Harry Chan's avatar
Harry Chan committed
74
### Running script targeting specific approach
Long Chung Chan's avatar
Long Chung Chan committed
75

Harry Chan's avatar
Harry Chan committed
76
## Repo Breakdown
Long Chung Chan's avatar
Long Chung Chan committed
77

Harry Chan's avatar
Harry Chan committed
78
## Scale-sim change
Long Chung Chan's avatar
Long Chung Chan committed
79

LongChan's avatar
LongChan committed
80
## License
Long Chung Chan's avatar
Long Chung Chan committed
81
This tool is distributed under MIT license.
LongChan's avatar
LongChan committed
82
Copyright (c) 2019 Long Chung Chan, Gurshaant Singh Malik, Nachiket Kapre
Long Chung Chan's avatar
Long Chung Chan committed
83
84
85
86
87
88
89
90
91
92
93
94
95

<div style="text-align: justify;"> 
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
<br><br>
</div>

<div style="text-align: justify;"> 
<b>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</b>
<br><br>
</div>

<div style="text-align: justify;"> 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Harry Chan's avatar
Harry Chan committed
96
</div>