Skip to content

[Tracking Issue] [TOPI][Signal][Relax] Add native rfft2d op with C++ registered backend #19764

@fnhirwa

Description

@fnhirwa

Background

The Relax TFLite frontend PR (#19763) adds support for the FFT/complex operator family
(REAL, IMAG, COMPLEX_ABS, RFFT2D). REAL, IMAG, and COMPLEX_ABS
are fully implemented. RFFT2D currently raises OpNotImplemented because no
viable lowering path exists.

Problem

topi.signal.dft exists in python/tvm/topi/signal.py as a pure Python TE
extern but has no TVM_REGISTER_GLOBAL entry anywhere in src/. Verified:

grep -rn "TVM_REGISTER_GLOBAL.*dft\|TVM_REGISTER_GLOBAL.*fft" src/ --include="*.cc"
# empty

python3 -c "import tvm, tvm.topi; print(tvm.get_global_func('topi.signal.dft', allow_missing=True))"
# None

There is no relax.op FFT primitive either:

grep -rn "def fft\|def rfft\|def dft" python/tvm/relax/op/ --include="*.py"
# empty

call_dps_packed("topi.signal.dft", ...) therefore fails at runtime and there
is nothing in relax.op to compose with.

This issue is to track progress for FEATURE NAME

  • [TOPI][Signal][Relax] Add native rfft2d op with C++ registered backend

Proposed work

  • Add rfft2d to src/topi/signal.cc with a TVM_REGISTER_GLOBAL entry
  • Add a legalization rule in python/tvm/relax/transform/legalize_ops/
  • Expose as relax.op.signal.rfft2d
  • Update the TFLite frontend convert_rfft2d handler to route through it
  • Add unit and E2E tests

References

cc @junrushao

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype:rfc-trackingRFC progress tracking. Ref: https://github.com/apache/tvm-rfcs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions