2.3.8
2.3.8
Important
Starting with onnx2tf v2.4.0, tf_converter will be deprecated and the default backend will be switched to flatbuffer_direct. With the v2.3.3 update, all backward compatible conversion options have been migrated to flatbuffer_direct, so I will only be doing minor bug fixes until April. If you provide us with ONNX sample models, I will consider incorporating them into flatbuffer_direct. I'll incorporate ai-edge-quantizer when I feel like it, but that will probably be about 10 years from now.
1. Content and background
This PR continues the feat-torch* line of work by tightening the native export path around flatbuffer_direct and the generated PyTorch artifacts.
The branch focuses on practical reliability improvements for the direct ModelIR-based path that is intended to become the main conversion flow:
- fixes native PyTorch export failures and numerical regressions seen in real models such as Faster R-CNN style graphs and
finder.onnx - improves
flatbuffer_directlowering and validation behavior for shape/index/control-flow related edge cases - expands direct-path test coverage so regressions are caught earlier in both export and evaluation stages
- updates the package version to
2.3.8 - refreshes the publish workflow dependency baseline for Node 24
From a feature-improvement perspective, the main outcome is that flatbuffer_direct now behaves more like a first-class backend end-to-end: direct export, native PyTorch package generation, accuracy checking, and related validation/reporting are more consistent and substantially more robust on non-trivial graphs.
2. Summary of corrections
Key improvements included in this branch:
-
Fixed native torch export regressions affecting
flatbuffer_directoutput packages.- corrected reshape/layout handling in generated PyTorch code so rank-2 flatten paths and singleton-axis drops no longer introduce invalid channel-last permutations
- resolved a
GridSample-adjacent accuracy regression where coordinate helper reshapes were reordered incorrectly in the generated package - improved native export behavior for Faster R-CNN related graph patterns
-
Strengthened
flatbuffer_directlowering and runtime shape handling.- extended lowering support in shape/index/control-flow related builders and registry validation
- improved ModelIR-to-PyTorch codegen around reshape, slice/strided-slice, gather/gather_nd, integer division, and related dynamic-shape cases
- added runtime-side support needed by the updated generated code paths
-
Expanded test coverage for direct export and native artifact generation.
- added focused PyTorch exporter regression tests for reshape/layout preservation and singleton-axis handling
- added/extended
flatbuffer_directtests covering direct lowering, validation, and numerical/runtime edge cases - kept README and package metadata aligned with the new behavior and release version
-
Updated release and CI metadata.
- bumped version metadata to
2.3.8 - updated the publish workflow dependency baseline for Node 24
- bumped version metadata to
3. Before/After (If there is an operating log that can be used as a reference)
A representative real-model regression fixed in this branch was the finder.onnx direct export flow.
Command:
onnx2tf -i finder.onnx -o tmp_finder -tb flatbuffer_direct -cotof -fdopt -fdots -fdodo -fdoepBefore:
ONNX/TFLite: passONNX/PyTorch: fail- representative metrics:
max_abs=0.043901rmse=0.01257cosine=0.999059
After:
ONNX/TFLite: passONNX/PyTorch: pass- representative metrics:
max_abs=6.84522e-08rmse=2.1783e-08cosine=1
Validation performed for this branch:
- targeted PyTorch exporter regression tests for the new reshape/layout fixes: passed
- full
flatbuffer_directfocused test run:pytest -q tests -k flatbuffer_direct- result:
685 passed, 393 deselected, 3 warnings
4. Issue number (only if there is a related issue)
No related issue was linked for this change set.