Skip to content

[Relax] Legalize dilated conv_transpose#19842

Open
guan404ming wants to merge 1 commit into
apache:mainfrom
guan404ming:fix/conv-transpose-dilation-legalize
Open

[Relax] Legalize dilated conv_transpose#19842
guan404ming wants to merge 1 commit into
apache:mainfrom
guan404ming:fix/conv-transpose-dilation-legalize

Conversation

@guan404ming

Copy link
Copy Markdown
Member

Why

relax.nn.conv{1,2,3}d_transpose with dilation > 1 silently bailed in legalize and then crashed in VM codegen with an opaque error (#19694).

How

  • Lower dilation > 1 by zero-filling (dilating) the kernel, then reusing the existing TOPI transposed-conv compute (1D/2D/3D).
  • Replace remaining silent bails for non-NCHW layouts and out_layout != data_layout with clear OpNotImplemented errors; will try to follow up with a layout-sandwich so those configs lower too.
  • Add a 2D-dilation structural test plus a layout/out_layout raises test.

Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for dilated transposed convolutions (1D, 2D, and 3D) in Relax's legalization pass by spatially dilating the kernel using TOPI's dilate operator before calling the transposed convolution. Additionally, it changes the behavior for unsupported layouts/dilations to raise tvm.error.OpNotImplemented instead of silently logging and returning the original call. Corresponding unit tests have been added to verify the new dilation support and the raised exceptions. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@guan404ming

Copy link
Copy Markdown
Member Author

cc @tlopex

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant