Aharrypotter opened a new pull request, #19824:
URL: https://github.com/apache/tvm/pull/19824
## Summary
This PR adds explicit Relax TFLite frontend handling for the TFLite builtin
operator markers from #19519 item H:
- `DELEGATE`
- `PLACEHOLDER_FOR_GREATER_OP_CODES`
These builtins are TFLite marker / pseudo operators rather than ordinary
tensor
operators. The frontend now recognizes them and raises a targeted
`OpNotImplemented` diagnostic instead of falling through to a generic
unsupported-operator path.
## Design
`DELEGATE` marks delegated TFLite subgraphs, and
`PLACEHOLDER_FOR_GREATER_OP_CODES` is a schema compatibility placeholder.
They
do not have Relax tensor semantics to lower. This PR therefore keeps the
importer conservative:
- both builtin names are added to the TFLite `convert_map`
- both route to a shared `convert_operator_marker` guard
- the guard reports that the marker is not a Relax tensor operator
This makes the unsupported status intentional and discoverable without
mapping
the markers to synthetic Relax ops.
## Tests
The tests manually build minimal TFLite flatbuffers containing each marker
builtin and assert that import raises the targeted `OpNotImplemented`.
Local validation:
```bash
python -m ruff format \
python/tvm/relax/frontend/tflite/tflite_frontend.py \
tests/python/relax/test_frontend_tflite.py
python -m ruff check \
python/tvm/relax/frontend/tflite/tflite_frontend.py \
tests/python/relax/test_frontend_tflite.py
python -m pytest \
tests/python/relax/test_frontend_tflite.py \
-k operator_marker_unsupported -q
```
Result:
```text
ruff format: 2 files left unchanged
ruff check: All checks passed
operator_marker_unsupported tests: 2 passed, 535 deselected
```
## References
- Issue #19519 item H: TFLite operator markers
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]