Xilinx / finn

Dataflow compiler for QNN inference on FPGAs
https://xilinx.github.io/finn
BSD 3-Clause "New" or "Revised" License
681 stars 218 forks source link

[Thresholding RTL] Prepend dummy threshold for narrow range quantization #1010

Closed azizb-xlnx closed 3 months ago

azizb-xlnx commented 3 months ago

binary-search thresholding RTL expects 2^N-1 thresholds, however, Brevitas implements signed activations using "narrow range" which drops one quantized values to keep the symmetry around 0. to get around this, we prepend a dummy threshold and offset the bias by -1.