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
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
Background
The Relax TFLite frontend PR (#19763) adds support for the FFT/complex operator family
(
REAL,IMAG,COMPLEX_ABS,RFFT2D).REAL,IMAG, andCOMPLEX_ABSare fully implemented.
RFFT2Dcurrently raisesOpNotImplementedbecause noviable lowering path exists.
Problem
topi.signal.dftexists inpython/tvm/topi/signal.pyas a pure Python TEextern but has no
TVM_REGISTER_GLOBALentry anywhere insrc/. Verified:There is no
relax.opFFT primitive either:call_dps_packed("topi.signal.dft", ...)therefore fails at runtime and thereis nothing in
relax.opto compose with.This issue is to track progress for FEATURE NAME
Proposed work
rfft2dtosrc/topi/signal.ccwith aTVM_REGISTER_GLOBALentrypython/tvm/relax/transform/legalize_ops/relax.op.signal.rfft2dconvert_rfft2dhandler to route through itReferences
python/tvm/relax/frontend/tflite/tflite_frontend.pypython/tvm/topi/signal.pycc @junrushao