Skip to content

Commit

Permalink
Run TFLite ConvertFunctionMetadataPass on FuncOp. (#8443)
Browse files Browse the repository at this point in the history
This pass did not appear to be running and the tests that would have caught it were disabled.

Found while helping with #8412
  • Loading branch information
ScottTodd authored Mar 3, 2022
1 parent 1ba31e0 commit 85cfb4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion integrations/tensorflow/iree_tf_compiler/TFL/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void buildTFLImportPassPipeline(OpPassManager &pm) {
//----------------------------------------------------------------------------

pm.addPass(createConvertModuleMetadataPass());
pm.nest<ModuleOp>().addPass(createConvertFunctionMetadataPass());
pm.nest<FuncOp>().addPass(createConvertFunctionMetadataPass());

//----------------------------------------------------------------------------
// Convert all TFL ops to TOSA ops
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ iree_lit_test_suite(
include = ["*.mlir"],
),
data = glob(["*.tflite"]),
# TODO: These tests have never passed
tags = [
"manual",
"nokokoro",
"notap",
],
tools = [
"//iree_tf_compiler:iree-import-tflite",
"@llvm-project//llvm:FileCheck",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: iree-import-tflite iree_tf_compiler/test/TFL/add.tflite | FileCheck %s
// RUN: iree-import-tflite %S/add.tflite | FileCheck %s

// CHECK: module {
// CHECK-NEXT: func @main(%arg0: tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32> attributes {tf.entry_function = {inputs = "input", outputs = "output"}} {
// CHECK-NEXT: func @main(%arg0: tensor<1x8x8x3xf32> {iree.identifier = "input"}) -> (tensor<1x8x8x3xf32> {iree.identifier = "output"}) {
// CHECK-NEXT: %0 = "tosa.add"(%arg0, %arg0) : (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32>
// CHECK-NEXT: %1 = "tosa.add"(%0, %arg0) : (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32>
// CHECK-NEXT: return %1 : tensor<1x8x8x3xf32>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: iree-import-tflite iree_tf_compiler/test/TFL/multi_add.tflite | FileCheck %s
// RUN: iree-import-tflite %S/multi_add.tflite | FileCheck %s

// CHECK: module {
// CHECK-NEXT: func @main(%arg0: tensor<1x8x8x3xf32>, %arg1: tensor<1x8x8x3xf32>, %arg2: tensor<1x8x8x3xf32>, %arg3: tensor<1x8x8x3xf32>) -> (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) attributes {tf.entry_function = {inputs = "a,b,c,d", outputs = "x,y"}} {
// CHECK-NEXT: func @main(%arg0: tensor<1x8x8x3xf32> {iree.identifier = "a"}, %arg1: tensor<1x8x8x3xf32> {iree.identifier = "b"}, %arg2: tensor<1x8x8x3xf32> {iree.identifier = "c"}, %arg3: tensor<1x8x8x3xf32> {iree.identifier = "d"}) -> (tensor<1x8x8x3xf32> {iree.identifier = "x"}, tensor<1x8x8x3xf32> {iree.identifier = "y"}) {
// CHECK-NEXT: %0 = "tosa.add"(%arg1, %arg2) : (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32>
// CHECK-NEXT: %1 = "tosa.add"(%arg0, %0) : (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32>
// CHECK-NEXT: %2 = "tosa.add"(%arg3, %0) : (tensor<1x8x8x3xf32>, tensor<1x8x8x3xf32>) -> tensor<1x8x8x3xf32>
Expand Down

0 comments on commit 85cfb4c

Please sign in to comment.