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
{{ message }}
Repository navigation
[Feature][Relax][ONNX] Support QLinearAdd operator in Relax ONNX frontend #20961
The ONNX QLinearAdd operator is currently unsupported in TVM Relax's ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py).
QLinearAdd performs element-wise binary addition on 8-bit quantized tensors with independent scale and zero-point parameters for each input and the output:
Should we consider distinguishing between symmetric and asymmetric quantization during ONNX frontend parsing, particularly regarding zero-point handling?
As discussed in [my comment on #20959](#20959 (comment)), when a zero point is statically known to be zero, the corresponding correction operation is mathematically unnecessary.
For QLinearAdd, this means:
The subtraction A - a_zero_point can be omitted when a_zero_point == 0.
The subtraction B - b_zero_point can be omitted when b_zero_point == 0.
The addition of c_zero_point after requantization can be omitted when c_zero_point == 0.
Handling both symmetric and asymmetric quantization through the same generic parsing logic may introduce redundant operations into the generated Relax IR, especially for common symmetric INT8 quantization cases.
It might be worth checking the actual zero-point values during ONNX frontend parsing and generating a simplified expression whenever they are compile-time constants equal to zero, while retaining the general implementation for non-zero or runtime zero points.
Would it be preferable to handle this optimization directly in the ONNX frontend, or should we rely on subsequent Relax optimization passes to eliminate these redundant operations?
Activity
PengYoun9 commentedon Nov 18, 2026
Should we consider distinguishing between symmetric and asymmetric quantization during ONNX frontend parsing, particularly regarding zero-point handling?
As discussed in [my comment on #20959](#20959 (comment)), when a zero point is statically known to be zero, the corresponding correction operation is mathematically unnecessary.
For
QLinearAdd, this means:A - a_zero_pointcan be omitted whena_zero_point == 0.B - b_zero_pointcan be omitted whenb_zero_point == 0.c_zero_pointafter requantization can be omitted whenc_zero_point == 0.Handling both symmetric and asymmetric quantization through the same generic parsing logic may introduce redundant operations into the generated Relax IR, especially for common symmetric INT8 quantization cases.
It might be worth checking the actual zero-point values during ONNX frontend parsing and generating a simplified expression whenever they are compile-time constants equal to zero, while retaining the general implementation for non-zero or runtime zero points.
Would it be preferable to handle this optimization directly in the ONNX frontend, or should we rely on subsequent Relax optimization passes to eliminate these redundant operations?