[Tracking Issue][TFlite] Expand Missing / Partial Operator Coverage
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 4k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 112
Description
## Background
Excited to see the huge progress the community has made on the Relax TFLite frontend recently — many operators and tests have landed in the last few weeks. To keep pushing this forward, this issue tracks the remaining operator gap so contributors can pick up well-scoped items in parallel.
## A. Good-first-issues — drop-in mappings
Workflow: add a handler, wire into `convert_map` (alphabetical within its region), add one `verify(TestClass, Expected)` test in `tests/python/relax/test_frontend_tflite.py` (pattern at L55). **All target Relax ops already exist** — no new op work needed.
- [x] `CUMSUM` → `relax.op.cumsum`
- [x] `UNIQUE` → `relax.op.unique`
- [x] `SCATTER_ND` → `relax.op.scatter_nd`
- [x] `BROADCAST_TO` → `relax.op.broadcast_to`
- [x] `SIGN` → `relax.op.sign`
- [x] `BITWISE_XOR` → `relax.op.bitwise_xor`
- [x] `RIGHT_SHIFT` → `relax.op.right_shift`
- [x] `BUCKETIZE` → `relax.op.bucketize`
- [x] `EMBEDDING_LOOKUP` → `relax.op.take`
- [x] `SELECT_V2` → `relax.op.where`
- [x] `RELU_0_TO_1` → `relax.op.clip`
- [x] `NON_MAX_SUPPRESSION_V4` → port from existing `convert_nms_v5`
## B. Medium — may need new Relax op or non-trivial decomposition
**Prefer composing with existing Relax ops over adding a new op.** Only register a new `relax.op.*` when the semantics genuinely cannot be expressed by existing primitives (e.g. random generators, bit-level reinterpret). If a decomposition using existing ops is feasible, go with that — it's a smaller PR and avoids bloating the op set.
- [x] `REDUCE_ANY` — commented at `tflite_frontend.py:198`; can be lowered to `relax.op.max` on a bool tensor, no new op needed
- [x] `REDUCE_ALL` — same, lower to `relax.op.min` on bool
- [ ] `RANK` — emit `relax.const(ndim)` for static shapes; no op call needed
- [x] `ATAN2` — compose from `atan` + `sign` + `where`, or add `relax.op.atan2` for a cleaner impl
- [x] `SEGMENT_SUM` — reuse `relax.op.scatter_nd` with `reduction="add"` (TFLite requires sorted segment ids)
- [ ] `UNSORTED_SEGMENT_SUM` — `scatter_nd(reduction="add")`
- [ ] `UNSORTED_SEGMENT_MAX` — `scatter_nd(reduction="max")`
- [x] `UNSORTED_SEGMENT_MIN` — `scatter_nd(reduction="min")`
- [x] `UNSORTED_SEGMENT_PROD` — `scatter_nd(reduction="mul")`
- [ ] `DYNAMIC_UPDATE_SLICE` — reuse `relax.op.slice_scatter`
- [x] `DILATE` — likely needs a new op (or decompose via `pad` + `strided_slice`)
- [x] `MULTINOMIAL` — wrap existing `relax.op.multinomial_from_uniform`; blocked on `RANDOM_UNIFORM`
- [x] `RANDOM_STANDARD_NORMAL` — needs a new random-generator op in Relax
- [x] `RANDOM_UNIFORM` — same
- [x] `BITCAST` — needs a new reinterpret/view op
- [x] `BROADCAST_ARGS` — shape-level computation; consider static-shape-only path first
## C. Fix partial implementations
These ops are already in `convert_map` but their handler raises `OpNotImplemented` on certain input patterns, making them unusable on real models that hit those patterns.
- [x] `RANGE` — handler raises on dynamic scalar inputs (`tflite_frontend.py:958`); should lower to `relax.op.arange`.
- [x] `FILL` — handler raises when `dims` is non-constant (`L1729`); should lower to `relax.op.full` with a dynamic shape
- [x] `SPLIT_V` — handler raises when `size_splits` is non-constant (`L2267`); decompose into dynamic strided slices.
- [x] `NON_MAX_SUPPRESSION_V5` — handler raises on soft-NMS (`L3546`); needs `soft_nms_sigma != 0` support
- [ ] `FAKE_QUANT` — handler raises on some narrow-range vector configs (`L3913`)
## Contributor workflow
1. Claim an item by commenting on this issue before starting, so we avoid duplicated work.
2. Read a recent reference PR for handler + test style.
3. Add the handler, register in `convert_map` (alphabetical within its region).
4. Add a structural-equal test following the `verify(TestClass, Expected)` pattern (`test_frontend_tflite.py:55`). Nightly-gated E2E activates automatically via `CI_ENV_NIGHTLY`.
5. Tag the PR title `[Relax][Frontend][TFLite]`.
cc @leandron
Contributor guide
No contributing guide indexed for this repository
Research direction
Choose one unchecked operator and inspect its handler area in tflite_frontend.py, then read a recent reference PR for the conversion and registration style. Add the handler to convert_map and a structural-equality test in tests/python/relax/test_frontend_tflite.py following the verify(TestClass, Expected) pattern at line 55; done means the targeted operator is covered by the test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100