We just rebuilt the TFLite frontend.
Today, tests/python/relax/test_frontend_tflite.py already covers a subset of operators, including some via parametrized tests (for example RELU, RELU6, TANH, SOFTMAX, LOGISTIC, ARG_MIN, and ARG_MAX). However, its test coverage is still not enough.
This issue tracks adding operator-focused unit tests for supported non-quantized operators that are still under-tested or currently have no explicit coverage in the Relax TFLite frontend.
Candidate operators to cover
The list below is based on the current Relax frontend implementation and the current contents of tests/python/relax/test_frontend_tflite.py.
Shape / indexing / layout
Elementwise / activation / comparison / normalization
Reductions
Resize
Convolution / linear / pooling
Padding / sparse / other
Suggested contribution style
- Small PRs are welcome. A PR can add coverage for one operator or a small related group
of operators.
- Please reuse the existing test style in
tests/python/relax/test_frontend_tflite.py.
- For simple conversions, checking the generated Relax IR with
tvm.ir.assert_structural_equal is preferred. We really appreciate you provide Expected IRModule to test those ops
- For larger operators, using the existing
verify(...) helper pattern is also fine, following current tests in the file.
- Numerical E2E checks should continue to follow the current nightly-only behavior guarded
by CI_ENV_NIGHTLY.
Useful reference
The old Relay test file is a good source of test shapes, edge cases, and operator-specific scenarios:
tests/python/frontend/tflite/test_forward.py at commit 292ecfd210
Notes for contributors
This is a good-first-issue / parallelizable tracking issue:
- each operator test is mostly independent
- multiple PRs can land in parallel
- contributors can reference this issue and check off the operator(s) covered by their PR
If you pick this up, please mention which operator(s) your PR adds coverage for.
And if you find some issues with existed ops when adding tests, you're welcome to fix them as well!
cc @leandron
We just rebuilt the TFLite frontend.
Today,
tests/python/relax/test_frontend_tflite.pyalready covers a subset of operators, including some via parametrized tests (for exampleRELU,RELU6,TANH,SOFTMAX,LOGISTIC,ARG_MIN, andARG_MAX). However, its test coverage is still not enough.This issue tracks adding operator-focused unit tests for supported non-quantized operators that are still under-tested or currently have no explicit coverage in the Relax TFLite frontend.
Candidate operators to cover
The list below is based on the current Relax frontend implementation and the current contents of
tests/python/relax/test_frontend_tflite.py.Shape / indexing / layout
SQUEEZESTRIDED_SLICESLICESHAPESELECT/WHEREGATHERGATHER_NDREVERSE_V2REVERSE_SEQUENCETILEUNPACKZEROS_LIKERANGESPLIT_VSPACE_TO_BATCH_NDBATCH_TO_SPACE_NDDEPTH_TO_SPACESPACE_TO_DEPTHElementwise / activation / comparison / normalization
HARD_SWISHLEAKY_RELURELU_N1_TO_1PRELULOGLOG_SOFTMAXSQUARED_DIFFERENCEGREATERGREATER_EQUALL2_NORMALIZATIONLOCAL_RESPONSE_NORMALIZATIONReductions
MEANREDUCE_MAXREDUCE_MINREDUCE_PRODSUMResize
RESIZE_BILINEARRESIZE_NEAREST_NEIGHBORConvolution / linear / pooling
FULLY_CONNECTEDDEPTHWISE_CONV_2DTRANSPOSE_CONVL2_POOL_2DPadding / sparse / other
PADPADV2MIRROR_PADONE_HOTMATRIX_DIAGMATRIX_SET_DIAGTOPK_V2SPARSE_TO_DENSEDENSIFY(sparse-to-dense tensor; may need a network-level test rather than asimple unit test)
Suggested contribution style
of operators.
tests/python/relax/test_frontend_tflite.py.tvm.ir.assert_structural_equalis preferred. We really appreciate you provideExpected IRModuleto test those opsverify(...)helper pattern is also fine, following current tests in the file.by
CI_ENV_NIGHTLY.Useful reference
The old Relay test file is a good source of test shapes, edge cases, and operator-specific scenarios:
tests/python/frontend/tflite/test_forward.pyat commit292ecfd210Notes for contributors
This is a good-first-issue / parallelizable tracking issue:
If you pick this up, please mention which operator(s) your PR adds coverage for.
And if you find some issues with existed ops when adding tests, you're welcome to fix them as well!
cc @leandron