Skip to content

Long latency in ternary tanh due to comparison with fractional number

Javier Duarte requested to merge github/fork/jngadiub/master into master

Created by: jngadiub

I noticed that after the fix to the ternary tanh activation function in this commit

https://github.com/hls-fpga-machine-learning/hls4ml/pull/114/commits/e81e98bc128bc15c6e650c4f6350073a7cec66be

the latency for the activation function operation increased from 0 to 7 clock cycles. It seems it is due to the comparison with a fraction number (0.5 in this case). In this PR I changed such that the data are multiplied by 2 and the comparison is done with 1. This change brings the latency for the ternary tanh back to 0.

Merge request reports

Loading