[Feature][Relax][ONNX] Support STFT (Short-Time Fourier Transform) operator in Relax ONNX frontend

未关闭
#20,966 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Start with python/tvm/relax/frontend/onnx/onnx_frontend.py and the ONNX opset 17 STFT specification in the issue. Check how the frontend handles the related DFT operator and how its tests cover ONNX imports. Done means STFT models import successfully with framing, optional windowing, and the expected real and imaginary output shape.

由索引模型根据 Issue 内容生成。

描述

Feature Description

Support the ONNX STFT (Short-Time Fourier Transform) operator in the Apache TVM Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py).

Motivation

In ONNX opset 17, DFT and STFT were introduced as the standard Fourier transform operators for audio and signal processing pipelines. While DFT support is being added, STFT is currently missing in the Relax ONNX frontend.

STFT is widely used in speech recognition, audio processing, and generative audio pipelines (such as Whisper, EnCodec, AudioLDM), which segment raw waveforms into overlapping windowed frames and compute discrete Fourier transforms. Importing ONNX models containing STFT fails with:

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

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

Operator Specification (ONNX Opset 17+)
  • Inputs:
    1. signal: Input tensor of shape (batch, signal_length) or (batch, signal_length, 1) or (batch, signal_length, 2) (for complex audio signal).
    2. frame_step: Scalar integer representing the hop size between consecutive frames.
    3. window (optional): 1-D window tensor (e.g. Hann, Hamming) of length frame_length.
    4. frame_length (optional): Scalar integer representing the length of each frame (defaults to window length if window is provided).
  • Attributes:
    • onesided: int (default 1) - whether to return half spectrum for real signals.
  • Outputs:
    1. output: 4-D tensor of shape (batch, frames, dft_unique_bins, 2) representing real and imaginary frequency components.
Expected Behavior

The Relax ONNX frontend should implement STFT by framing the input signal (sliding window with frame_step and frame_length), applying the window function if provided, and computing discrete Fourier transforms across frames.

主要语言
Python
星标
13.9k
派生
4.1k
平均合并
4 天 22 小时
30 天内合并 PR
22

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/tvm 的其他 Issue

查看 apache/tvm 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。