question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SetFolding sets erroneous PE and SIMD attributes for In- and Outwidth parameters for StreamingDWC

See original GitHub issue

For 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)

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
neilkimncommented, Mar 16, 2021

Update: As expected, using a manual folding configuration, as specified by cnv_end2end_example, and setting the auto_fifo_depths = False in the DataflowBuildConfig resolves the issue. I assume the bug can be narrowed down to how the SetFolding of the step_target_fps_parallelization interacts with step_set_fifo_depths when both auto_fifo_depths = True and target_fps is set.

1reaction
maltanarcommented, May 20, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found