From b55de5bc4ee2fbd160bd17cea24479439bb83390 Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Thu, 16 Jan 2025 12:47:51 -0800 Subject: [PATCH] Mark TFLite (TOSA) model tests XFAIL and log a compatibility warning. --- .../tflite/scripts/iree_import_tflite/__main__.py | 13 +++++++++++++ .../tensorflow/test/iree_tfl_tests/gpt2.run | 1 + .../test/iree_tfl_tests/person_detect.run | 1 + 3 files changed, 15 insertions(+) diff --git a/integrations/tensorflow/python_projects/iree_tflite/iree/tools/tflite/scripts/iree_import_tflite/__main__.py b/integrations/tensorflow/python_projects/iree_tflite/iree/tools/tflite/scripts/iree_import_tflite/__main__.py index 35b24384f1e7..a5e6f291e2f1 100644 --- a/integrations/tensorflow/python_projects/iree_tflite/iree/tools/tflite/scripts/iree_import_tflite/__main__.py +++ b/integrations/tensorflow/python_projects/iree_tflite/iree/tools/tflite/scripts/iree_import_tflite/__main__.py @@ -51,6 +51,19 @@ def main(): if args.output_format != "mlir-bytecode": logging.warning("output-format option is deprecated, emitting MLIR bytecode") + # Log compatibility warnings for some known issues. + try: + from packaging import version + from tensorflow import __version__ as tf_version + + # https://discourse.llvm.org/t/rfc-tosa-dialect-increment-to-v1-0/83708 + if version.parse(tf_version) <= version.parse("2.18.0"): + logging.warning( + f"Found tensorflow version {tf_version}. Versions of tensorflow<=2.18.0 have known compatibility issues with TOSA v1.0. Consider using a newer tensorflow version or iree-base-compiler<=3.1.0" + ) + except: + pass + tflite_to_tosa( flatbuffer=args.flatbuffer, bytecode=args.output_path, diff --git a/integrations/tensorflow/test/iree_tfl_tests/gpt2.run b/integrations/tensorflow/test/iree_tfl_tests/gpt2.run index 4e95ab6b4d11..7869cb10b21e 100644 --- a/integrations/tensorflow/test/iree_tfl_tests/gpt2.run +++ b/integrations/tensorflow/test/iree_tfl_tests/gpt2.run @@ -1 +1,2 @@ # RUN: %PYTHON -m iree_tfl_tests.gpt2_test --artifacts_dir=%t +# XFAIL: * diff --git a/integrations/tensorflow/test/iree_tfl_tests/person_detect.run b/integrations/tensorflow/test/iree_tfl_tests/person_detect.run index cf8517b0404c..3808b7187b22 100644 --- a/integrations/tensorflow/test/iree_tfl_tests/person_detect.run +++ b/integrations/tensorflow/test/iree_tfl_tests/person_detect.run @@ -1 +1,2 @@ # RUN: %PYTHON -m iree_tfl_tests.person_detect_test --artifacts_dir=%t +# XFAIL: *