Skip to content

[Relax][Frontend][ONNX] Add DFT operator converter - #20952

Open
Chaitanya140904 wants to merge 1 commit into
apache:mainfrom
Chaitanya140904:relax-onnx-dft
Open

Chaitanya140904 wants to merge 1 commit into
apache:mainfrom
Chaitanya140904:relax-onnx-dft

Conversation

@Chaitanya140904

@Chaitanya140904 Chaitanya140904 commented Nov 9, 2026 •

Copy link
Copy Markdown

This PR adds support for the ONNX DFT operator in the Relax ONNX frontend, resolving #20960.

Key Changes

  • In python/tvm/relax/frontend/onnx/onnx_frontend.py:
    • Implemented DFT op converter supporting opset 17 and 20.
    • Supports forward and inverse DFT, full spectrum and one-sided spectrum (onesided=1).
    • Supports both real ([..., 1]) and complex ([..., 2]) inputs.
    • Supports axis as attribute (opset 17) and axis as input tensor (opset 20).
    • Handles signal zero-padding and truncation with dft_length.
    • Formulates transform via matrix multiplication with precomputed trigonometric matrices (C = cos(2*pi*n*k/N), S = sin(2*pi*n*k/N)) over Relax ops.
    • Registered "DFT": DFT in _get_convert_map().
  • In tests/python/relax/test_frontend_onnx.py:
    • Added test_dft covering real forward full, real forward onesided, complex inverse, dft_length padding/truncating, axis=0, and opset 17/20, validated against ONNX Runtime.

Closes #20960.

@Chaitanya140904

Copy link
Copy Markdown
Author

Hi @mshr-h, @yzhliu, @tqchen, @akaashrp

Could you please take a look at this PR when you get a chance?

This branch has not been deployed

No deployments
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.

[Feature][Relax][ONNX] Support DFT (Discrete Fourier Transform) in Relax ONNX frontend

1 participant