Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all build flow to have specified specialize layers config json #98

Merged
merged 11 commits into from
Jun 26, 2024
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ build/finn
*.link_summary
*.onnx
*.pyc
*.npz
*.npy
output_*/
release/
*.egg-info
2 changes: 2 additions & 0 deletions build/bnn-pynq/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def platform_to_shell(platform):
generate_outputs=[build_cfg.DataflowOutputType.BITFILE],
save_intermediate_models=True,
default_swg_exception=True,
specialize_layers_config_file="specialize_layers_config/%s_specialize_layers.json"
% model_name,
)
model_file = "models/%s.onnx" % model_name
# launch FINN compiler to build
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"ConvolutionInputGenerator_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_1": {
"preferred_impl_style": "rtl"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_2": {
"preferred_impl_style": "rtl"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_3": {
"preferred_impl_style": "rtl"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_1": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_4": {
"preferred_impl_style": "rtl"
},
"MVAU_4": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_5": {
"preferred_impl_style": "rtl"
},
"MVAU_5": {
"preferred_impl_style": "hls"
},
"MVAU_6": {
"preferred_impl_style": "hls"
},
"MVAU_7": {
"preferred_impl_style": "hls"
},
"MVAU_8": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"ConvolutionInputGenerator_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_1": {
"preferred_impl_style": "rtl"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_2": {
"preferred_impl_style": "rtl"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_3": {
"preferred_impl_style": "rtl"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_1": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_4": {
"preferred_impl_style": "rtl"
},
"MVAU_4": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_5": {
"preferred_impl_style": "rtl"
},
"MVAU_5": {
"preferred_impl_style": "hls"
},
"MVAU_6": {
"preferred_impl_style": "hls"
},
"MVAU_7": {
"preferred_impl_style": "hls"
},
"MVAU_8": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"ConvolutionInputGenerator_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_1": {
"preferred_impl_style": "rtl"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_0": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_2": {
"preferred_impl_style": "rtl"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_3": {
"preferred_impl_style": "rtl"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"StreamingMaxPool_1": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_4": {
"preferred_impl_style": "rtl"
},
"MVAU_4": {
"preferred_impl_style": "hls"
},
"ConvolutionInputGenerator_5": {
"preferred_impl_style": "rtl"
},
"MVAU_5": {
"preferred_impl_style": "hls"
},
"MVAU_6": {
"preferred_impl_style": "hls"
},
"MVAU_7": {
"preferred_impl_style": "hls"
},
"MVAU_8": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Defaults": {},
"Thresholding_0": {
"preferred_impl_style": "rtl"
},
"MVAU_0": {
"preferred_impl_style": "hls"
},
"MVAU_1": {
"preferred_impl_style": "hls"
},
"MVAU_2": {
"preferred_impl_style": "hls"
},
"MVAU_3": {
"preferred_impl_style": "hls"
},
"LabelSelect_0": {
"preferred_impl_style": "hls"
}
}
2 changes: 1 addition & 1 deletion build/get-finn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# URL for git repo to be cloned
REPO_URL=https://github.com/Xilinx/finn
# commit hash for repo
REPO_COMMIT=39fb8859fec0e47276ffadcafe43092d1b10af7e
REPO_COMMIT=9cd8bab4d5ebd6895716fad41753256542cc314f
# directory (under the same folder as this script) to clone to
REPO_DIR=finn

Expand Down
4 changes: 2 additions & 2 deletions build/gtsrb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def platform_to_shell(platform):
synth_clk_period_ns=10.0,
board=platform_name,
steps=custom_build_steps,
folding_config_file="folding_config/cnv_gtsrb_folding_config.json",
folding_config_file="folding_config/gtsrb_folding_config.json",
shell_flow_type=shell_flow_type,
vitis_platform=vitis_platform,
generate_outputs=[
Expand All @@ -107,7 +107,7 @@ def platform_to_shell(platform):
build_cfg.DataflowOutputType.DEPLOYMENT_PACKAGE,
build_cfg.DataflowOutputType.PYNQ_DRIVER,
],
save_intermediate_models=True,
specialize_layers_config_file="specialize_layers_config/gtsrb_specialize_layers.json",
)
model_file = "models/%s.onnx" % model_name
# launch FINN compiler to build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"MVAU_hls_0": {
"PE": 16,
"SIMD": 3,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"ConvolutionInputGenerator_rtl_1": {
"SIMD": 32,
Expand All @@ -19,7 +20,8 @@
"MVAU_hls_1": {
"PE": 32,
"SIMD": 32,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"ConvolutionInputGenerator_rtl_2": {
"SIMD": 32,
Expand All @@ -28,7 +30,8 @@
"MVAU_hls_2": {
"PE": 16,
"SIMD": 32,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"ConvolutionInputGenerator_rtl_3": {
"SIMD": 32,
Expand All @@ -37,7 +40,8 @@
"MVAU_hls_3": {
"PE": 16,
"SIMD": 32,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"ConvolutionInputGenerator_rtl_4": {
"SIMD": 32,
Expand All @@ -46,7 +50,8 @@
"MVAU_hls_4": {
"PE": 4,
"SIMD": 32,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"ConvolutionInputGenerator_rtl_5": {
"SIMD": 32,
Expand All @@ -55,22 +60,26 @@
"MVAU_hls_5": {
"PE": 1,
"SIMD": 32,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"MVAU_hls_6": {
"PE": 1,
"SIMD": 4,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"MVAU_hls_7": {
"PE": 1,
"SIMD": 8,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"MVAU_hls_8": {
"PE": 4,
"SIMD": 1,
"ram_style": "auto"
"ram_style": "auto",
"resType": "lut"
},
"LabelSelect_hls_0": {
"PE": 1
Expand Down
2 changes: 1 addition & 1 deletion build/gtsrb/models/download-model.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
wget https://github.com/fastmachinelearning/qonnx_model_zoo/raw/feature/gtsrb_cnv/models/GTSRB/Brevitas_CNV1W1A/cnv_1w1a_gtsrb.onnx
wget https://github.com/fastmachinelearning/qonnx_model_zoo/raw/main/models/GTSRB/Brevitas_CNV1W1A/cnv_1w1a_gtsrb.onnx
Loading
Loading