-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed conv's unittest (wrong shape for bias), added bank opt python s…
…cripts from DP-FGPA-V1
- Loading branch information
Showing
7 changed files
with
286 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Memory Bank Optimizer | ||
`scripts/bank_optimizer_v2.py` is created to find optimized memory banks for the kernels with the objective of minimizing the number of `DataMover` kernel launches needed to execute the computation graph of the selected `TopModelArch`. | ||
|
||
# Instructions | ||
1. Run the selected `CModel` on FPGA for `hostlog_0trace.log` to be created. | ||
2. Open `hostlog_0trace.log` and find the lines that after `Dumping bank-crossing logs for` and append them. | ||
3. Copy the these lines into `bank_optimizer_v2.py`, method `get_objective` and line `objective =` | ||
4. Assign the allowed banks per kernel like `banks_transpose=[1,2]` to allow banks one and two to be selected for kernel `Transpose`, or `banks_transpose=[1]` to force the kernel to use only the bank one. | ||
5. Run the script. | ||
6. Use the output to configure `config` submodule of the main `DeepPoint-V2-FPGA` repository and then rebuild the FPGA image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Results | ||
Here the results of the various FPGA runs on AWS F1 could be found. | ||
To avoid including the related files in the git repository, they are lined below as github release archives. | ||
|
||
## Archive Links | ||
///TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import numpy as np | ||
|
||
|
||
class SlrStats: | ||
def __init__(self, slr_index, util_bram, util_dsp, util_ff, util_lut, util_uram): | ||
self.slr_index = slr_index | ||
self.util_bram = util_bram | ||
self.util_dsp = util_dsp | ||
self.util_ff = util_ff | ||
self.util_lut = util_lut | ||
self.util_uram = util_uram | ||
|
||
def __add__(self, other): | ||
if not(self.slr_index == -1 and other.slr_index == -1): | ||
assert self.slr_index == other.slr_index | ||
return SlrStats( | ||
self.slr_index, | ||
self.util_bram + other.util_bram, | ||
self.util_dsp + other.util_dsp , | ||
self.util_ff + other.util_ff , | ||
self.util_lut + other.util_lut , | ||
self.util_uram + other.util_uram | ||
) | ||
|
||
def __str__(self): | ||
return ''.join([ | ||
"BRAM=",str(self.util_bram),'%, ', | ||
"DSP=",str(self.util_dsp),'%, ', | ||
"FF=",str(self.util_ff),'%, ', | ||
"LUT=",str(self.util_lut),'%, ', | ||
"URAM=",str(self.util_uram),'%, ', | ||
]) | ||
|
||
def __lt__(self, other): | ||
return self.util_bram < other.util_bram and \ | ||
self.util_dsp < other.util_dsp and \ | ||
self.util_ff < other.util_ff and \ | ||
self.util_lut < other.util_lut and \ | ||
self.util_uram < other.util_uram | ||
|
||
|
||
class KernelObj: | ||
def __init__(self, kernel_name, possible_banks, util_bram, util_dsp, util_ff, util_lut, util_uram, assigned_bank=-1): | ||
self.kernel_name = kernel_name | ||
self.possible_banks = possible_banks | ||
self.assigned_bank = assigned_bank | ||
self.util_stats = SlrStats(-1, util_bram, util_dsp, util_ff, util_lut, util_uram) | ||
|
||
def get_slr(self): | ||
if self.assigned_bank == 1: | ||
return 2 | ||
if self.assigned_bank == 2: | ||
return 1 | ||
assert False | ||
|
||
def clone(self, assigned_bank=-1): | ||
return KernelObj( | ||
self.kernel_name, | ||
self.possible_banks, | ||
self.util_stats.util_bram, | ||
self.util_stats.util_dsp, | ||
self.util_stats.util_ff, | ||
self.util_stats.util_lut, | ||
self.util_stats.util_uram, | ||
assigned_bank) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters