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

Ensure 2 bits for scale in po2 quantizers #531

Merged
merged 1 commit into from May 10, 2022

Conversation

vloncar
Copy link
Contributor

@vloncar vloncar commented Apr 26, 2022

In a corner-case of using alpha=auto_po2 the computed number of bits for scale can be 1. This results in a creation of a 1-bit signed type (e.g., ap_int<1>). While Vivado compiler will still work with this type, on Quartus side the ac_int<1> will fail compilation. This change ensures that at least 2 bits are reserved for scale, avoiding the problem.

@vloncar vloncar requested a review from thesps April 26, 2022 17:15
@thesps thesps merged commit 309a527 into fastmachinelearning:master May 10, 2022
@vloncar vloncar deleted the po2_fix branch March 5, 2023 17:42
calad0i pushed a commit to calad0i/hls4ml that referenced this pull request Jul 1, 2023
Ensure 2 bits for scale in po2 quantizers
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.

None yet

2 participants