I-BERT icon indicating copy to clipboard operation
I-BERT copied to clipboard

rationale considering in using floor or round

Open CaoZhongZ opened this issue 4 years ago • 1 comments
trafficstars

❓ What is the rationale behind floor or round

I see softmax and polynomial use floor but other places use round. What is the consideration?

CaoZhongZ avatar Jun 23 '21 07:06 CaoZhongZ

For quantization operations (e.g., QuantLinear), we normally use a round-to-nearest policy instead of floor as they are more sensitive to rounding errors. Rounding produces less error than floor in general. When computing polynomial (e.g., softmax), I simply used floor operation as it is less sensitive to rounding error. However, you can use rounding as well.

kssteven418 avatar Jun 23 '21 11:06 kssteven418