Merge pull request #4696 from google/benvanik-tf-compiler-cleanup
diff --git a/bindings/python/pyiree/compiler2/tflite.py b/bindings/python/pyiree/compiler2/tflite.py index 64f9bf2..8047fd7 100644 --- a/bindings/python/pyiree/compiler2/tflite.py +++ b/bindings/python/pyiree/compiler2/tflite.py
@@ -100,6 +100,8 @@ cl = [ import_tool, input_path, + "--mlir-print-op-generic", + "--mlir-print-debuginfo", ] if options.import_only and options.output_file: # Import stage directly outputs.
diff --git a/integrations/tensorflow/iree_tf_compiler/BUILD b/integrations/tensorflow/iree_tf_compiler/BUILD index ba1aabc..b87785d 100644 --- a/integrations/tensorflow/iree_tf_compiler/BUILD +++ b/integrations/tensorflow/iree_tf_compiler/BUILD
@@ -18,59 +18,11 @@ licenses = ["notice"], # Apache 2.0 ) -cc_library( - name = "tensorflow", - srcs = [ - "ConvertToMHLO.cpp", - "LowerExportedFunctions.cpp", - "LowerGlobalTensors.cpp", - "Passes.cpp", - "PropagateResourceCasts.cpp", - "StripMetadata.cpp", - "VerifyFullyConverted.cpp", - ], - hdrs = [ - "Passes.h", - ], - defines = [ - "IREE_COMPILER_TENSORFLOW_ENABLED", - ], - deps = [ - "//iree_tf_compiler/dialect/tf_strings/conversion:convert_tf_strings_to_strings", - "//iree_tf_compiler/dialect/tf_strings/conversion:convert_tf_to_tf_strings", - "//iree_tf_compiler/dialect/tf_strings/ir:dialect", - "//iree_tf_compiler/dialect/tf_tensorlist/conversion:convert_tf_tensorlist_to_tensorlist", - "//iree_tf_compiler/dialect/tf_tensorlist/conversion:convert_tf_to_tf_tensorlist", - "//iree_tf_compiler/dialect/tf_tensorlist/ir:tf_tensorlist_dialect", - "@iree//iree/base:signature_mangle", - "@iree//iree/compiler/Dialect/Flow/IR", - "@iree//iree/compiler/Dialect/IREE/IR", - "@iree//iree/compiler/Dialect/Shape/Conversion", - "@iree//iree/compiler/Dialect/Shape/Transforms", - "@llvm-project//llvm:Support", - "@llvm-project//mlir:IR", - "@llvm-project//mlir:Pass", - "@llvm-project//mlir:Shape", - "@llvm-project//mlir:ShapeTransforms", - "@llvm-project//mlir:StandardOps", - "@llvm-project//mlir:Support", - "@llvm-project//mlir:TensorDialect", - "@llvm-project//mlir:TransformUtils", - "@org_tensorflow//tensorflow/compiler/mlir/hlo", - "@org_tensorflow//tensorflow/compiler/mlir/hlo:chlo_legalize_to_hlo", - "@org_tensorflow//tensorflow/compiler/mlir/tensorflow", - "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:lower_tf_lib", - "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:tensorflow_types", - "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:tf_saved_model_passes", - "@org_tensorflow//tensorflow/compiler/mlir/xla:xla_legalize_tf", - ], -) - cc_binary( name = "iree-tf-opt", srcs = ["iree-tf-opt-main.cpp"], deps = [ - ":tensorflow", + "//iree_tf_compiler/TF", "//iree_tf_compiler/dialect/tf_strings/ir:dialect", "//iree_tf_compiler/dialect/tf_tensorlist/ir:tf_tensorlist_dialect", "@iree//iree/tools:init_xla_dialects", @@ -88,7 +40,7 @@ name = "iree-tf-import", srcs = ["iree-tf-import-main.cpp"], deps = [ - ":tensorflow", + "//iree_tf_compiler/TF", "@llvm-project//llvm:Support", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", @@ -129,6 +81,7 @@ name = "iree-import-xla", srcs = ["iree-import-xla-main.cpp"], deps = [ + "//iree_tf_compiler/TF", "@llvm-project//llvm:Support", "@llvm-project//mlir:IR", "@llvm-project//mlir:Support",
diff --git a/integrations/tensorflow/iree_tf_compiler/README.md b/integrations/tensorflow/iree_tf_compiler/README.md index 01fdba4..27071ad 100644 --- a/integrations/tensorflow/iree_tf_compiler/README.md +++ b/integrations/tensorflow/iree_tf_compiler/README.md
@@ -2,24 +2,24 @@ dialect and related dialects (with the exception of a small selection of "safe" XLA IR). -## Tools +# Tools -### Development Tools +## Development Tools * `iree-tf-opt` : MLIR Opt tool with TensorFlow and IREE passes/dialects linked in * `iree-tf-translate` : Equivalent to `mlir-tf-translate` tool in TensorFlow, with IREE passes/dialects linked in -### Production Tools +## Production Tools -#### iree-tf-import +### iree-tf-import `iree-tf-import` provides a single entry-point for compiling TensorFlow saved models to "IREE Input Dialects" that can be fed to `iree-translate` or `iree-opt` and operated on further. -##### Usage: +#### Usage ```shell iree-tf-import /path/to/saved_model_v2 @@ -30,3 +30,25 @@ # --tf-savedmodel-exported-names=subset,of,exported,names # --tf-savedmodel-tags=serving ``` + +# Testing + +```shell +$ bazel test :saved_model_adopt_exports +``` + +This will capture the output and pass it through FileCheck and report pass/fail, +along with a hopefully informative description of what failed. + +## Debugging failures + +During development, it can be useful to just see the raw output directly. + +To see the raw output of the MLIR import and conversion process: + +```shell +$ bazel run :saved_model_adopt_exports -- --disable_filecheck +``` + +Look for the `RUN_TEST: <test_name>` and `FINISH_TEST: <test_name>` lines to +narrow in on the test that interests you.
diff --git a/integrations/tensorflow/iree_tf_compiler/TF/BUILD b/integrations/tensorflow/iree_tf_compiler/TF/BUILD new file mode 100644 index 0000000..0503827 --- /dev/null +++ b/integrations/tensorflow/iree_tf_compiler/TF/BUILD
@@ -0,0 +1,67 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) + +cc_library( + name = "TF", + srcs = [ + "ConvertToMHLO.cpp", + "LowerExportedFunctions.cpp", + "LowerGlobalTensors.cpp", + "Passes.cpp", + "PropagateResourceCasts.cpp", + "StripMetadata.cpp", + "VerifyFullyConverted.cpp", + ], + hdrs = [ + "Passes.h", + ], + defines = [ + "IREE_COMPILER_TENSORFLOW_ENABLED", + ], + deps = [ + "//iree_tf_compiler/dialect/tf_strings/conversion:convert_tf_strings_to_strings", + "//iree_tf_compiler/dialect/tf_strings/conversion:convert_tf_to_tf_strings", + "//iree_tf_compiler/dialect/tf_strings/ir:dialect", + "//iree_tf_compiler/dialect/tf_tensorlist/conversion:convert_tf_tensorlist_to_tensorlist", + "//iree_tf_compiler/dialect/tf_tensorlist/conversion:convert_tf_to_tf_tensorlist", + "//iree_tf_compiler/dialect/tf_tensorlist/ir:tf_tensorlist_dialect", + "@iree//iree/base:signature_mangle", + "@iree//iree/compiler/Dialect/Flow/IR", + "@iree//iree/compiler/Dialect/IREE/IR", + "@iree//iree/compiler/Dialect/Shape/Conversion", + "@iree//iree/compiler/Dialect/Shape/Transforms", + "@llvm-project//llvm:Support", + "@llvm-project//mlir:IR", + "@llvm-project//mlir:Pass", + "@llvm-project//mlir:Shape", + "@llvm-project//mlir:ShapeTransforms", + "@llvm-project//mlir:StandardOps", + "@llvm-project//mlir:Support", + "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", + "@org_tensorflow//tensorflow/compiler/mlir/hlo", + "@org_tensorflow//tensorflow/compiler/mlir/hlo:chlo_legalize_to_hlo", + "@org_tensorflow//tensorflow/compiler/mlir/tensorflow", + "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:lower_tf_lib", + "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:tensorflow_types", + "@org_tensorflow//tensorflow/compiler/mlir/tensorflow:tf_saved_model_passes", + "@org_tensorflow//tensorflow/compiler/mlir/xla:xla_legalize_tf", + ], +)
diff --git a/integrations/tensorflow/iree_tf_compiler/ConvertToMHLO.cpp b/integrations/tensorflow/iree_tf_compiler/TF/ConvertToMHLO.cpp similarity index 99% rename from integrations/tensorflow/iree_tf_compiler/ConvertToMHLO.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/ConvertToMHLO.cpp index 72306db..e6b8de3 100644 --- a/integrations/tensorflow/iree_tf_compiler/ConvertToMHLO.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/ConvertToMHLO.cpp
@@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h" #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h" #include "mlir-hlo/Dialect/mhlo/transforms/rewriters.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/LowerExportedFunctions.cpp b/integrations/tensorflow/iree_tf_compiler/TF/LowerExportedFunctions.cpp similarity index 99% rename from integrations/tensorflow/iree_tf_compiler/LowerExportedFunctions.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/LowerExportedFunctions.cpp index fcc4615..dddb2a7 100644 --- a/integrations/tensorflow/iree_tf_compiler/LowerExportedFunctions.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/LowerExportedFunctions.cpp
@@ -15,7 +15,7 @@ #include "iree/base/signature_mangle.h" #include "iree/compiler/Dialect/Flow/IR/FlowDialect.h" #include "iree/compiler/Dialect/Flow/IR/FlowOps.h" -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/ADT/STLExtras.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/MLIRContext.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/LowerGlobalTensors.cpp b/integrations/tensorflow/iree_tf_compiler/TF/LowerGlobalTensors.cpp similarity index 99% rename from integrations/tensorflow/iree_tf_compiler/LowerGlobalTensors.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/LowerGlobalTensors.cpp index 78a9f46..f4e4ff9 100644 --- a/integrations/tensorflow/iree_tf_compiler/LowerGlobalTensors.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/LowerGlobalTensors.cpp
@@ -17,7 +17,7 @@ #include "iree/compiler/Dialect/Flow/IR/FlowOps.h" #include "iree/compiler/Dialect/IREE/IR/IREEDialect.h" #include "iree/compiler/Dialect/IREE/IR/IREETypes.h" -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/STLExtras.h" #include "mlir/IR/Attributes.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/Passes.cpp b/integrations/tensorflow/iree_tf_compiler/TF/Passes.cpp similarity index 99% rename from integrations/tensorflow/iree_tf_compiler/Passes.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/Passes.cpp index b7d8906..40f72a9 100644 --- a/integrations/tensorflow/iree_tf_compiler/Passes.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/Passes.cpp
@@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "iree/compiler/Dialect/Shape/Conversion/Passes.h" #include "iree/compiler/Dialect/Shape/Transforms/Passes.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/Passes.h b/integrations/tensorflow/iree_tf_compiler/TF/Passes.h similarity index 94% rename from integrations/tensorflow/iree_tf_compiler/Passes.h rename to integrations/tensorflow/iree_tf_compiler/TF/Passes.h index c7c3a83..309a7e3 100644 --- a/integrations/tensorflow/iree_tf_compiler/Passes.h +++ b/integrations/tensorflow/iree_tf_compiler/TF/Passes.h
@@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_PASSES_H_ -#define IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_PASSES_H_ +#ifndef IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_TF_PASSES_H_ +#define IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_TF_PASSES_H_ #include "iree_tf_compiler/dialect/tf_strings/conversion/convert_tf_strings_to_strings.h" #include "iree_tf_compiler/dialect/tf_strings/conversion/convert_tf_to_tf_strings.h" @@ -91,4 +91,4 @@ } // namespace iree_integrations } // namespace mlir -#endif // IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_PASSES_H_ +#endif // IREE_INTEGRATIONS_TENSORFLOW_IREE_TF_COMPILER_TF_PASSES_H_
diff --git a/integrations/tensorflow/iree_tf_compiler/PropagateResourceCasts.cpp b/integrations/tensorflow/iree_tf_compiler/TF/PropagateResourceCasts.cpp similarity index 98% rename from integrations/tensorflow/iree_tf_compiler/PropagateResourceCasts.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/PropagateResourceCasts.cpp index ed21fa7..64bce1d 100644 --- a/integrations/tensorflow/iree_tf_compiler/PropagateResourceCasts.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/PropagateResourceCasts.cpp
@@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "mlir/IR/BuiltinOps.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/StripMetadata.cpp b/integrations/tensorflow/iree_tf_compiler/TF/StripMetadata.cpp similarity index 98% rename from integrations/tensorflow/iree_tf_compiler/StripMetadata.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/StripMetadata.cpp index 13d47c0..ce6a4ba 100644 --- a/integrations/tensorflow/iree_tf_compiler/StripMetadata.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/StripMetadata.cpp
@@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "iree_tf_compiler/TF/Passes.h" #include "mlir/Pass/Pass.h" #include "mlir/Support/LLVM.h" #include "tensorflow/compiler/mlir/tensorflow/ir/tf_device.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/VerifyFullyConverted.cpp b/integrations/tensorflow/iree_tf_compiler/TF/VerifyFullyConverted.cpp similarity index 98% rename from integrations/tensorflow/iree_tf_compiler/VerifyFullyConverted.cpp rename to integrations/tensorflow/iree_tf_compiler/TF/VerifyFullyConverted.cpp index 767c9e4..0b24ebb 100644 --- a/integrations/tensorflow/iree_tf_compiler/VerifyFullyConverted.cpp +++ b/integrations/tensorflow/iree_tf_compiler/TF/VerifyFullyConverted.cpp
@@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/Support/FormatVariadic.h" #include "mlir/Pass/Pass.h" #include "mlir/Support/LLVM.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/TF/test/BUILD b/integrations/tensorflow/iree_tf_compiler/TF/test/BUILD new file mode 100644 index 0000000..1ed07b9 --- /dev/null +++ b/integrations/tensorflow/iree_tf_compiler/TF/test/BUILD
@@ -0,0 +1,31 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@iree//iree:lit_test.bzl", "iree_lit_test_suite") + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) + +iree_lit_test_suite( + name = "lit", + srcs = glob(["*.mlir"]), + data = [ + "//iree_tf_compiler:iree-tf-opt", + "@iree//iree/tools:IreeFileCheck", + ], + driver = "@iree//iree/tools:run_lit.sh", +)
diff --git a/integrations/tensorflow/iree_tf_compiler/TF/test/CMakeLists.txt b/integrations/tensorflow/iree_tf_compiler/TF/test/CMakeLists.txt new file mode 100644 index 0000000..287b33f --- /dev/null +++ b/integrations/tensorflow/iree_tf_compiler/TF/test/CMakeLists.txt
@@ -0,0 +1,26 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +iree_add_all_subdirs() + +file(GLOB _GLOB_X_MLIR LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS *.mlir) +iree_lit_test_suite( + NAME + lit + SRCS + "${_GLOB_X_MLIR}" + DATA + iree::tools::IreeFileCheck + iree_tf_compiler_iree-tf-opt +)
diff --git a/integrations/tensorflow/iree_tf_compiler/test/convert_to_mhlo.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/convert_to_mhlo.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/convert_to_mhlo.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/convert_to_mhlo.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors_complex.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors_complex.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors_complex.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors_complex.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors_invalid.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors_invalid.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/lower_global_tensors_invalid.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/lower_global_tensors_invalid.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/propagate_resource_casts.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/propagate_resource_casts.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/propagate_resource_casts.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/propagate_resource_casts.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/strip_metadata.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/strip_metadata.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/strip_metadata.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/strip_metadata.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/test/verify_fully_converted.mlir b/integrations/tensorflow/iree_tf_compiler/TF/test/verify_fully_converted.mlir similarity index 100% rename from integrations/tensorflow/iree_tf_compiler/test/verify_fully_converted.mlir rename to integrations/tensorflow/iree_tf_compiler/TF/test/verify_fully_converted.mlir
diff --git a/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp index ed667d7..44307d9 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp
@@ -42,24 +42,24 @@ static cl::opt<std::string> outputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-")); - static llvm::cl::opt<std::string> saveTempTflInput( + + static cl::opt<std::string> saveTempTflInput( "save-temp-tfl-input", - llvm::cl::desc("Save the TFL pipeline input to this file"), - llvm::cl::init("")); - static llvm::cl::opt<std::string> saveTempIreeImport( + cl::desc("Save the TFL pipeline input to this file"), cl::init("")); + static cl::opt<std::string> saveTempIreeImport( "save-temp-iree-input", - llvm::cl::desc("Save the resultant IR to this file (useful for saving an " - "intermediate in a pipeline)"), - llvm::cl::init("")); + cl::desc("Save the resultant IR to this file (useful for saving an " + "intermediate in a pipeline)"), + cl::init("")); static cl::list<std::string> inputArrayFlag( "input-array", - llvm::cl::desc("Input tensor, if different from the default inputs"), - llvm::cl::ZeroOrMore); + cl::desc("Input tensor, if different from the default inputs"), + cl::ZeroOrMore); static cl::list<std::string> outputArrayFlag( "output-array", - llvm::cl::desc("Output tensor, if different from the default outputs"), - llvm::cl::ZeroOrMore); + cl::desc("Output tensor, if different from the default outputs"), + cl::ZeroOrMore); // Register any command line options. registerAsmPrinterCLOptions(); @@ -112,8 +112,6 @@ return failure(); } OpPrintingFlags printFlags; - printFlags.enableDebugInfo(); - printFlags.printGenericOpForm(); module->print(outputFile->os(), printFlags); outputFile->os() << "\n"; outputFile->keep();
diff --git a/integrations/tensorflow/iree_tf_compiler/iree-tf-import-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-tf-import-main.cpp index 4697ae1..93d0365 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-tf-import-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-tf-import-main.cpp
@@ -20,7 +20,7 @@ // Since none of the TensorFlow imports come from an MLIR text form, it is a bit // of an odd fit for a *-translate style tool, which is why this diverges. -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/InitLLVM.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp index 935f9db..e1104b0 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp
@@ -19,7 +19,7 @@ // each addition will likely end up on the build critical path. #include "iree/tools/init_xla_dialects.h" -#include "iree_tf_compiler/Passes.h" +#include "iree_tf_compiler/TF/Passes.h" #include "llvm/Support/InitLLVM.h" #include "mlir/IR/Dialect.h" #include "mlir/Support/MlirOptMain.h"
diff --git a/integrations/tensorflow/iree_tf_compiler/test/README.md b/integrations/tensorflow/iree_tf_compiler/test/README.md deleted file mode 100644 index e008d61..0000000 --- a/integrations/tensorflow/iree_tf_compiler/test/README.md +++ /dev/null
@@ -1,21 +0,0 @@ -# Running tests manually - -```shell -$ bazel test :saved_model_adopt_exports -``` - -This will capture the output and pass it through FileCheck and report pass/fail, -along with a hopefully informative description of what failed. - -# Debugging failures - -During development, it can be useful to just see the raw output directly. - -To see the raw output of the MLIR import and conversion process: - -```shell -$ bazel run :saved_model_adopt_exports -- --disable_filecheck -``` - -Look for the `RUN_TEST: <test_name>` and `FINISH_TEST: <test_name>` lines to -narrow in on the test that interests you.