Skip to content

[Feature][Relax][ONNX] Support QLinearMatMul in Relax ONNX frontend #20958

Open

Description

@Chaitanya140904

Description

The ONNX QLinearMatMul operator (opsets 10 and 21) is currently missing from the Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py), as noted in RFC tracking issue #20124 under quantized operators.

QLinearMatMul computes 8-bit quantized matrix multiplication with 32-bit accumulation and dequantization/requantization:

Y = clip(round((A - a_zp) * (B - b_zp) * (s_a * s_b / s_y)) + y_zp, min_val, max_val)

Key Requirements

  • Support opset 10 (uint8) and opset 21 (int8, uint8, int16, uint16).
  • 32-bit integer accumulation to prevent intermediate arithmetic overflow.
  • Per-row and per-column zero-point and scale broadcasting.
  • Correct rounding and clipping to the output data type range.
  • Comprehensive unit tests verified against ONNX Runtime.

Reference PR

Implementation is available in PR #20951.

Triage

  • needs-triage
  • frontend:onnx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions