2.2.0
2.2.0
Summary
This PR consolidates the fix-rtmdet branch improvements focused on functional reliability, direct FlatBuffer export robustness, and conversion/typing stability across the ONNX->TFLite pipeline.
Compared to main, this branch contains 3 commits and broad updates across operator converters, the flatbuffer_direct backend, tests, and tooling.
Functional Improvements (Feature-level)
1. Stronger flatbuffer_direct lowering correctness
- Improved dynamic-shape handling for shape-sensitive graph patterns (notably in reshape/flatten/pad/reduce paths).
- Fixed edge cases where lowering metadata and runtime shape tensors could diverge.
- Tightened reduce-axis behavior so non-constant axes are rejected early in dispatch validation when required by
flatbuffer_directsemantics. - Stabilized dynamic PAD lowering flow by normalizing pads inputs through deterministic INT32 casting before reshape/transpose composition.
Impact:
- More predictable lowering behavior for dynamic ONNX graphs.
- Fewer latent runtime mismatches between static IR metadata and runtime tensor semantics.
2. Expanded and hardened operator conversion logic
- Updated many ONNX op converters in
onnx2tf/ops/*to improve type/shape safety and runtime consistency. - Replaced fragile tensor indexing/operator assumptions in multiple places with safer conversion patterns for dynamic tensors.
- Strengthened handling of optional values, dynamic dtypes, and tensor-vs-scalar branches.
Impact:
- Improved conversion success rate on real-world models (including RTMDet-related conversion paths).
- Reduced failure modes caused by ambiguous shape/dtype inference.
3. flatbuffer_direct coverage and validation alignment
- Aligned op coverage reporting and validation outcomes with actual builder constraints.
- Ensured unsupported reasons are surfaced consistently (for example,
requires_constant_inputfor dynamic reduce axes where applicable).
Impact:
- Coverage reports now better reflect true exportability constraints.
- Debugging unsupported nodes is more actionable.
4. Benchmarking and developer tooling improvements
- Added
benchmark_tflite.pyfor CPU/CUDA-oriented TFLite latency measurement workflows. - Minor CLI/package/docs alignment updates (
onnx2tf.py,__init__.py,README.md, etc.).
Impact:
- Easier performance characterization for converted artifacts.
- Better operational feedback loop when iterating on model conversion quality/performance.
Test and Quality Improvements
Added/updated direct-backend tests
- Extended
tests/test_tflite_builder_direct.pywith additional scenarios around dynamic pad/flatten/reshape behavior and related shape-signature expectations.
Validation status
Executed targeted flatbuffer_direct suites after fixes:
python -m pytest -q \
tests/test_tflite_builder_direct.py \
tests/test_tflite_builder_preprocess.py \
tests/test_tflite_builder_op_coverage.py \
tests/test_tflite_builder_gridsample_validation.py \
tests/test_flatbuffer_direct_op_error_report.py \
tests/test_tflite_split_planner.pyResult:
- 554 passed, 1 warning
Scope of Changes
- Large converter hardening across
onnx2tf/ops/*. - Core
flatbuffer_directupdates in:onnx2tf/tflite_builder/op_builders/shape.pyonnx2tf/tflite_builder/op_registry.py- additional related builder/utility modules.
- Benchmark tooling and docs updates.
Why this matters for fix-rtmdet
RTMDet export paths heavily depend on stable handling of dynamic tensor metadata, reshape/pad/reduce behavior, and consistent converter typing assumptions. This branch improves those exact stability points, reducing conversion-time ambiguity and increasing confidence in direct TFLite generation paths.
What's Changed
- Improve flatbuffer_direct reliability and converter robustness for RTMDet workflows by @PINTO0309 in #897
Full Changelog: 2.1.5...2.2.0