Description
Background
The TOSA MLIR dialect is one of IREE's accepted input formats, commonly used to compile and then run LiteRT / TensorFlow Lite programs. The TOSA MLIR dialect is in the process of incrementally upgrading to v1.0: https://discourse.llvm.org/t/rfc-tosa-dialect-increment-to-v1-0/83708. This will introduce a new backwards compatibility baseline after a series of breaking changes to operator definitions.
Warning
During this upgrade process, there will be several planned and unplanned breaking changes that will affect user and developer workflows.
Timelines
Already happened
Date | Event |
---|---|
2024-10-24 | TensorFlow 2.18.0 stable release: https://pypi.org/project/tensorflow/#history |
2025-01-08 | IREE 3.1.0 stable release: https://github.com/iree-org/iree/releases/tag/v3.1.0 |
2025-01-08 | TensorFlow removed the ExperimentalTFLiteToTosaBytecode function in tensorflow/tensorflow#83174 |
2025-01-17 | #19683 merged, IREE nightly releases and source builds are no longer compatible with existing TOSA .mlir files |
2025-02-10 | IREE 3.2.0 stable release (#19641) |
Upcoming
Date | Event |
---|---|
2025-?? | Next TensorFlow stable release (2.19.0?) |
2025-04 | Planned deadline for TOSA v1.0 changes to be rolled out |
Support plan
Given the existing and planned events, compatibility is expected to be:
- For
tensorflow<=2.18.0
, useiree-tools-tflite<=20250107.1133
andiree-base-compiler<=3.1.0
- For
iree-base-compiler>=3.2.0
(including current source builds), TOSA .mlir files are likely to be unsupported as the IREE compiler has started to include TOSA v1.0 breaking changes and TensorFlow does not generate the new format - For
tf-nightly
or newertensorflow
versions, the API thatiree-tools-tflite
relies on no longer exists
Our current plan is to
- Direct users to older versions of these packages:
tensorflow<=2.18.0 iree-tools-tflite<=20250107.1133 iree-base-compiler<=3.1.0
- Watch for changes to the TOSA MLIR dialect in MLIR and integrate them into IREE as they arrive
- Watch for a new .tflite to TOSA .mlir API to be added to TensorFlow (or another project like TFLite / LiteRT / etc.) then switch the
iree-import-tflite
script in theiree-tools-tflite
package to use it - Advertise support for TFLite/TOSA in IREE again after these changes have fully rolled out and have been tested
This could change with different engineering decisions (e.g. carrying more reverts in IREE). Feedback and patches are welcome.
References
- TFLite framework support page: https://iree.dev/guides/ml-frameworks/tflite/
input_tosa
compiler plugin source:compiler/plugins/input/TOSA
iree-tosa-input-transformation-pipeline
source:compiler/plugins/input/TOSA/InputConversion/Passes.cpp
iree-tools-tflite
Python project source:integrations/tensorflow/python_projects/iree_tflite
iree-import-tflite
script source:integrations/tensorflow/python_projects/iree_tflite/iree/tools/tflite/scripts/iree_import_tflite/__main__.py
Activity