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

Fix Vitis Conv1D/2D latency strategy #815

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

vloncar
Copy link
Contributor

@vloncar vloncar commented Jun 16, 2023

Description

This fixes #805. Vitis HLS compiler has problems with synthesizing pointer expressions like *(res++). Using array indexing resolves the compilation issue, but then the design fails to meet timing, due to the inlining of the conv_1d_latency_cl (ditto 2d) function. This seems to be on a per-layer (or model) basis, since it works sometimes. It's best to disable it to meet timing in the general case, but then people can explore enabling it to save a few cycles. I left a comment along those lines. I implemented it only for Vitis, but if people encounter the issue in Vivado we can use the same fix there, again bringing the backends to single-source HLS implementation.

Also, I used the opportunity to sneak a commit that fixes the Vitis pragma warnings regarding DATA_PACK pragma. This seems to be a leftover from a bad merge. The workaround used brings it in line with the rest of the codebase where we know it works.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Tests

Only synthesis will confirm this is the fix, and we don't (yet) have synthesis tests for Vitis, so this one is trust me bro type of PR. But @Duchstf will properly test it and report back, right Duc?

Checklist

I did all the things in the checklist.

@Duchstf
Copy link
Member

Duchstf commented Jun 19, 2023

I trust @vloncar on this PR, see #805.

@jmitrevs jmitrevs merged commit abaea98 into fastmachinelearning:main Jun 19, 2023
calad0i pushed a commit to calad0i/hls4ml that referenced this pull request Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please test Trigger testing by creating local PR branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Vitis hls] Cannot apply array transformation pragma/directive because of full array load/store.
3 participants