Skip to content

[Relax][Frontend][TFLite] Add bucketize/unique/sign + fixes#19522

Open
0xjah wants to merge 4 commits into
apache:mainfrom
0xjah:relax-tflite-missing-ops
Open

[Relax][Frontend][TFLite] Add bucketize/unique/sign + fixes#19522
0xjah wants to merge 4 commits into
apache:mainfrom
0xjah:relax-tflite-missing-ops

Conversation

@0xjah
Copy link
Copy Markdown
Contributor

@0xjah 0xjah commented May 8, 2026

Summary

  • add Relax TFLite handlers for BUCKETIZE, UNIQUE, SIGN, and RELU_0_TO_1
  • allow RANGE with dynamic scalar operands and guard FAKE_QUANT degenerate ranges
  • extend TFLite frontend tests for sign/unique/bucketize/fake_quant and dynamic range

Testing

  • not run (not requested)

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for several TFLite operators—BUCKETIZE, RELU_0_TO_1, SIGN, and UNIQUE—to the Relax frontend and enables dynamic scalar inputs for the RANGE operator. It also hardens FAKE_QUANT against division-by-zero errors in degenerate ranges. Review feedback identifies a semantic mismatch in the BUCKETIZE implementation regarding boundary matching, suggests using math.floor(x + 0.5) for TFLite-compliant rounding in quantized RELU_0_TO_1, and recommends adding a specific test case for the FAKE_QUANT degenerate range fix.

Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py Outdated
Comment thread tests/python/relax/test_frontend_tflite.py Outdated
Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py Outdated
Comment thread python/tvm/relax/frontend/tflite/tflite_frontend.py Outdated
Comment thread tests/python/relax/test_frontend_tflite.py Outdated
@tlopex
Copy link
Copy Markdown
Member

tlopex commented May 24, 2026

Could you have a look at CI and fix the error?

0xjah added 4 commits May 30, 2026 07:34
Rebase branch onto upstream/main (apache/tvm), resolving conflicts from
newly merged LSTM, RNN, CALL/CALL_ONCE, and resource-variable ops. Restore
uncommitted float32 guard in qnn_params to prevent fake-quant tensors from
being treated as quantized.
@0xjah 0xjah force-pushed the relax-tflite-missing-ops branch from 1373348 to 481ebd2 Compare May 30, 2026 04:42
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.

2 participants