The flatbuffer-direct execution path in onnx2tf has undergone a significant refactor to improve terminal shape handling and binary layout adaptation. This refactor introduces a series of specialized optimization passes designed to handle complex operator chains (like Concat, Mul, Add, Reshape, Transpose, and Attention) while maintaining strict topology, rank-four metadata, and QDIM (Quantized Dimension) remapping.
Key improvements across the new passes include:
- Strict Metadata Preflight: Ensures rank-four metadata and topology are validated before mutation.
- Ownership-Aware Constant Handling: Implements type-safe handling for INT32 constants used in Slice, Pad, and Shape operations.
- QDIM Remapping: Ensures dynamic signatures and quantized dimensions are correctly preserved during layout transformations.
- Provenance-Preserving Clones: Maintains the origin of shared constants and permutations during layout changes.
- Indexed Setters and Batched Removal: Uses a structured approach to update the
ModelIRGraphIndex and remove redundant nodes safely.