You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Allow narrow_range=1 for FakeQuantWithMinMaxVars. From tf-docs, when narrow_range=1
In case of 8 bits, narrow_range nudges the quantized range to be [-127, 127]
instead of [-128, 127]. This ensures symmetric range has 0 as the centre.
TensorRT converts QuantizeLinear and DeQuantizeLinear if and only if quantization scheme is symmetric and the zero_point = 0
This can be confirmed by setting narrow_range=False while creating the tensorflow model and then converting it to onnx format. The onnx model successfully creates QuantizeLinear and DeQuantizeLinear nodes, but when running with trtexec it halts with [6] Assertion failed: shiftIsAllZeros(zeroPoint) && "TRT only supports symmetric quantization - zeroPt must be all zeros"
Urgency
Blocked usecase, QAT TF-2.x ->ONNX model -> TensorRT Engine
System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
Tensorflow Version: 2.6.0, 2.7 nightly
Python version: 3.7
To Reproduce
Here is a minimal example that shows this
@jasdeep06 I created my own quantized weight layers using tf.quantization.quantize_and_dequantize_v2. This issue thread has some related information #1719
Describe the bug
Allow
narrow_range=1
forFakeQuantWithMinMaxVars
. From tf-docs, whennarrow_range=1
TensorRT converts
QuantizeLinear
andDeQuantizeLinear
if and only if quantization scheme is symmetric and thezero_point = 0
This can be confirmed by setting
narrow_range=False
while creating the tensorflow model and then converting it to onnx format. The onnx model successfully createsQuantizeLinear
andDeQuantizeLinear
nodes, but when running withtrtexec
it halts with[6] Assertion failed: shiftIsAllZeros(zeroPoint) && "TRT only supports symmetric quantization - zeroPt must be all zeros"
Urgency
Blocked usecase,
QAT TF-2.x
->ONNX model
->TensorRT Engine
System information
To Reproduce
Here is a minimal example that shows this
The text was updated successfully, but these errors were encountered: