[Feature][Relax][ONNX] Support ConvInteger operator in Relax ONNX frontend

Đang mở
#20,965 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
56/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Start in python/tvm/relax/frontend/onnx/onnx_frontend.py and read the existing MatMulInteger handling, then check the Relax convolution operators and ONNX frontend tests for how convolution attributes and optional inputs are represented. Add import support for ConvInteger with zero point adjustment, int32 accumulation, and the specified 1D, 2D, and 3D cases. Done means ONNX models containing these nodes import with the expected int32 output.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Feature Description

Support the ONNX ConvInteger operator in the Apache TVM Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py).

Motivation

While MatMulInteger is currently supported in the Relax ONNX frontend (computing (A - a_zero_point) * (B - b_zero_point) with int32 accumulation), its convolution counterpart ConvInteger (opset 10+) is currently missing.

ConvInteger is a foundational operator for integer-only quantized neural networks (e.g. integer CNNs, INT8 quantization pipelines). Importing ONNX models containing ConvInteger fails with:

NotImplementedError: The following operators are not supported: ['ConvInteger']

This operator was also highlighted in the ONNX coverage RFC tracking issue #20124 under Convolution operators.

Operator Specification (ONNX Opset 10+)
  • Inputs:
    1. x: N-D input tensor (uint8 or int8), shape (N, C, D1, D2, ...)
    2. w: N-D weight tensor (uint8 or int8), shape (M, C/group, k1, k2, ...)
    3. x_zero_point (optional): zero point for x (uint8 or int8, scalar or 1D tensor of shape (1,) or (C,))
    4. w_zero_point (optional): zero point for w (uint8 or int8, scalar or 1D tensor of shape (M,) for per-channel quantization)
  • Attributes:
    • auto_pad: string (NOTSET, SAME_UPPER, SAME_LOWER, VALID)
    • dilations: list of ints
    • group: int (default 1)
    • kernel_shape: list of ints
    • pads: list of ints
    • strides: list of ints
  • Outputs:
    1. y: N-D output tensor of type int32
Expected Behavior

The Relax ONNX frontend should import ConvInteger nodes by subtracting zero points from input and weight (broadcasting appropriately), upcasting to int32, performing convolution via relax.op.nn.conv1d / conv2d / conv3d, and returning int32 activations.

Ngôn ngữ chính
Python
Star
13.9k
Fork
4.1k
Merge trung bình
4 ngày 22 giờ
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/tvm

Tất cả issue của apache/tvm

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.