Skip to content

[Folding] Fixed AP_INT_MAX_W error and added throughput folding warnings #209

Open
bwintermann wants to merge 2 commits into
devfrom
fix/folding-limits
Open

[Folding] Fixed AP_INT_MAX_W error and added throughput folding warnings #209
bwintermann wants to merge 2 commits into
devfrom
fix/folding-limits

Conversation

@bwintermann
Copy link
Copy Markdown

@bwintermann bwintermann commented May 8, 2026

Previously, folding could create weight streams wider than configured in mvau_wwidth_max, since only SIMD, not PE was checked during folding. However for the MVAU_hls in internal_decoupled mode, the instream width is defined as simd*pe*bitwidth, so an unbounded PE value could cause the stream width to overshoot the limit.

Additionally, the MVAU_hls implementation failed to correctly verify that the AP_INT_MAX_W value was below the upper limit of 8191. The default and max value of this macro can be looked up in UG1399. This is now fixed and the HLSBackend and MVAU_hls check against a constant defined in finn.utils.basic.

Finally, in case that a node cannot reach the expected throughput (cycles per frame), a warning is printed.

  • Add percentage to lowered throughput warnings

@eki-project eki-project deleted a comment from github-actions Bot May 8, 2026
Comment thread src/finn/transformation/fpgadataflow/set_folding.py Outdated
@eki-project eki-project deleted a comment from github-actions Bot May 11, 2026
@bwintermann
Copy link
Copy Markdown
Author

@fpjentzsch I fixed the issue and reworded some of the warnings. I also added a check that warns the user if mvau_wwidth_max is larger than MAX_ALLOWED_AP_INT_W (not an exception, since I was unsure if this could be relevant for RTL components). Could you check that the warnings and the assertion make sense?

@bwintermann bwintermann added this to the FINN+ v1.5.0 milestone May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants