Skip to content

[Feature][Relax][ONNX] Support MelWeightMatrix operator in Relax ONNX frontend #20970

Open

Description

@Chaitanya140904

Feature Description

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

Motivation

MelWeightMatrix generates the triangular filterbank weight matrix used to transform linear-frequency discrete Fourier transform spectra into the perceptual Mel scale. It is a fundamental feature extraction stage in modern end-to-end speech and audio models (such as OpenAI Whisper, Conformer, and wav2vec 2.0).

Introduced in ONNX opset 17+, MelWeightMatrix is currently unsupported in the Relax ONNX frontend:

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

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. num_mel_bins: Scalar integer specifying the number of Mel frequency bands.
    2. dft_length: Scalar integer representing the length of the DFT window.
    3. sample_rate: Scalar integer representing the sampling rate in Hertz.
    4. lower_edge_hertz: Scalar float specifying the lower boundary of the filterbank in Hz.
    5. upper_edge_hertz: Scalar float specifying the upper boundary of the filterbank in Hz.
  • Attributes:
    • output_datatype: int (default TensorProto.FLOAT) - output numeric precision.
  • Outputs:
    1. output: 2D tensor of shape (dft_length // 2 + 1, num_mel_bins) containing the Mel filterbank matrix.

Expected Behavior

The Relax ONNX frontend should implement MelWeightMatrix by evaluating the triangular Mel filterbank matrix (either statically when inputs are constant initializers, or dynamically via Relax tensor operations).

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