onnxruntime
37be90c9 - [Quant tool]: Improve symmetric quantization range update for Relu/Clip (#21573)

Commit
1 year ago
[Quant tool]: Improve symmetric quantization range update for Relu/Clip (#21573) ### Description This PR improves the range calculation for input to Relu/Clip nodes for the symmetric quantization case. ### Motivation and Context Currently, the issue we face is that for the common scenario of conv followed by relu in the symmetric quantization config, different scales could assigned for the tensors corresponding to input & output of relu. The downside is that this may introduce noise due to multiple re-quant, and makes it difficult to fuse conv-relu nodes for hardware accelerators that support fused conv-relu. Instead, it is more efficient to assign the output range of relu as the input range of relu / output range of upstream op wherever possible. This adjustment is currently only being done for the asymmetric quantization case. For the scenario where the upstream op has multiple consumers, this assumption could be incorrect. For this case we do not adjust the ranges.
Author
Parents
Loading