Skip to content

[Feature][Relax][ONNX] Support DeformConv (Deformable Convolution) in Relax ONNX frontend #20968

Open

Description

@Chaitanya140904

Feature Description

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

Motivation

Deformable Convolution (DCNv2/DCNv3) is an essential architectural component in modern computer vision architectures for object detection, instance segmentation, and pose estimation (such as DETR, Mask DINO, and YOLOv9). It augments standard grid convolutions with learned 2D spatial offsets, allowing receptive fields to dynamically adapt to object scales and geometry.

Standardized in ONNX opset 19+, DeformConv is currently not supported in the Relax ONNX frontend. Importing ONNX models containing deformable convolutions fails with:

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

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

Operator Specification (ONNX Opset 19+)

  • Inputs:
    1. X: 4D input feature map (N, C_in, H_in, W_in).
    2. W: 4D weight tensor (C_out, C_in/group, kH, kW).
    3. offset: 4D offset tensor (N, 2 * offset_group * kH * kW, H_out, W_out) containing spatial sampling displacements.
    4. B (optional): 1D bias tensor (C_out).
    5. mask (optional): 4D modulation mask tensor (N, mask_group * kH * kW, H_out, W_out) for modulated deformable convolutions (DCNv2).
  • Attributes:
    • dilations: list of ints (default [1, 1])
    • group: int (default 1)
    • kernel_shape: list of ints
    • offset_group: int (default 1)
    • pads: list of ints
    • strides: list of ints (default [1, 1])
  • Outputs:
    1. Y: 4D output feature map (N, C_out, H_out, W_out).

Expected Behavior

The Relax ONNX frontend should convert DeformConv nodes into equivalent Relax calls by sampling spatial locations with bilinear interpolation based on the offsets and masks, and convolving with kernel weights.

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