SetFolding sets erroneous PE and SIMD attributes for In- and Outwidth parameters for StreamingDWC
See original GitHub issueFor any of the Brevitas BNN-PYNQ CNV test networks, running the DataflowBuildConfig
on them results in the step_set_fifo_depths
erroring out.
Manually setting the PE and SIMD attributes s.t. the InWidth
and OutWidth
of the StreamingDWC pass the assertions results in the notebook dying - likely due to it being OOM (How does this happen even if I am just changing the PE and SIMD parameters slightly?)
The documentation in the SetFolding
function carries a disclaimer that tuning the attributes by hand should return better results. Regardless, the algorithm should adhere to constraints further down the workflow, IMO. It was not possible for me to find where the InWidth
and OutWidth
attributes were set and thus pinpoint where things go wrong.
[imports omitted]
...
cnv_w1a1 = get_test_model_trained("CNV", 1, 1)
bo.export_finn_onnx(cnv_w1a1, (1, 3, 32, 32), "models/end2end_cnv_w1a1_export.onnx")
model_file_path = "models/end2end_cnv_w1a1_export.onnx"
model = ModelWrapper(model_file_path)
output_dir = 'output_test_w1a1'
cfg = build.DataflowBuildConfig(
output_dir = output_dir,
target_fps = 10000,
synth_clk_period_ns = 10.0,
board = "Pynq-Z1",
shell_flow_type = build_cfg.ShellFlowType.VIVADO_ZYNQ,
generate_outputs=[
build_cfg.DataflowOutputType.STITCHED_IP,
build_cfg.DataflowOutputType.RTLSIM_PERFORMANCE,
build_cfg.DataflowOutputType.OOC_SYNTH,
]
)
build.build_dataflow_cfg(model_file_path, cfg)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Update: As expected, using a manual folding configuration, as specified by
cnv_end2end_example
, and setting theauto_fifo_depths = False
in theDataflowBuildConfig
resolves the issue. I assume the bug can be narrowed down to how theSetFolding
of thestep_target_fps_parallelization
interacts withstep_set_fifo_depths
when bothauto_fifo_depths = True
andtarget_fps
is set.Besides the CNVs there’s the MobileNet-v1 on finn-examples, there are two different folding configs you could compare against in the dev branch: https://github.com/Xilinx/finn-examples/tree/dev/build/mobilenet-v1
…which will soon be joined by ResNet-50: https://github.com/Xilinx/finn-examples/pull/8