Add target environment constraints to more TensorFlow packages and targets.
PiperOrigin-RevId: 333668585 Change-Id: Id2312d95ff91c0ef662b750fd45bd95e8711753c
This commit is contained in:
		
							parent
							
								
									6f5f4c8c8e
								
							
						
					
					
						commit
						45f9c4a4ea
					
				@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "py_strict_binary")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test")
 | 
			
		||||
load("//tensorflow/core/platform:build_config.bzl", "if_llvm_aarch64_available", "if_llvm_system_z_available")
 | 
			
		||||
 | 
			
		||||
@ -304,7 +304,6 @@ cc_library(
 | 
			
		||||
    name = "aot_only_var_handle_op",
 | 
			
		||||
    srcs = ["aot_only_var_handle_op.cc"],
 | 
			
		||||
    hdrs = ["aot_only_var_handle_op.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    visibility = [
 | 
			
		||||
        "//tensorflow/compiler/tf2xla:__pkg__",
 | 
			
		||||
    ],
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,8 @@
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "genrule")
 | 
			
		||||
load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,8 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#   TensorFlow/TensorFlow Lite/XLA MLIR dialects and tools.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,10 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
 | 
			
		||||
# TODO(b/160617323): Decouple MLIR HLO from TensorFlow/XLA
 | 
			
		||||
@ -59,6 +66,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "MhloPassIncGen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
@ -75,6 +83,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "LmhloPassIncGen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
@ -91,6 +100,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "chlo_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "include/mlir-hlo/Dialect/mhlo/IR/chlo_ops.h.inc"),
 | 
			
		||||
@ -106,6 +116,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "hlo_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.h.inc"),
 | 
			
		||||
@ -130,6 +141,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "hlo_ops_base_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "include/mlir-hlo/Dialect/mhlo/IR/hlo_ops_base.h.inc"),
 | 
			
		||||
@ -142,6 +154,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "hlo_ops_pattern_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "lib/Dialect/mhlo/IR/",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
@ -164,6 +177,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "lhlo_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "include",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h.inc"),
 | 
			
		||||
@ -182,6 +196,7 @@ gentbl(
 | 
			
		||||
#TODO(aminim): revisit the naming and grouping of these rules post-move.
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "canonicalize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "lib/Dialect/mhlo/IR/",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-rewriters", "lib/Dialect/mhlo/IR/mhlo_canonicalize.inc"),
 | 
			
		||||
@ -196,6 +211,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "infer_fusibility_op_interface_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-interface-decls",
 | 
			
		||||
@ -571,6 +587,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "legalize_to_standard_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "lib/Dialect/mhlo/transforms/",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-rewriters", "lib/Dialect/mhlo/transforms/generated_legalize_to_standard.inc"),
 | 
			
		||||
@ -659,6 +676,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "lower_complex_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "lib/Dialect/mhlo/transforms/",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-rewriters", "lib/Dialect/mhlo/transforms/generated_lower_complex.inc"),
 | 
			
		||||
@ -751,6 +769,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "chlo_legalize_to_hlo_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    strip_include_prefix = "lib/Dialect/mhlo/transforms/",
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,9 @@
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test", "tf_native_cc_binary")
 | 
			
		||||
load(
 | 
			
		||||
    "//third_party/mlir:tblgen.bzl",
 | 
			
		||||
@ -37,6 +43,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -68,6 +75,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_op_interfaces_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-interface-decls",
 | 
			
		||||
@ -87,6 +95,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_prepare_tf_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -105,6 +114,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_lower_static_tensor_list_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -122,6 +132,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_legalize_tf_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -139,6 +150,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_optimize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -157,6 +169,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_quantize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -173,6 +186,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_lite_post_quantize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -522,6 +536,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "op_quant_spec_getters_inc",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [("", "utils/generated_op_quant_spec_getters.inc")],
 | 
			
		||||
    tblgen = "//tensorflow/compiler/mlir/lite/quantization:op_quant_spec_getters_gen",
 | 
			
		||||
    td_file = "ir/tfl_ops.td",
 | 
			
		||||
@ -547,6 +562,7 @@ tf_native_cc_binary(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "converter_inc",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "--gen-operator-converters",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = [
 | 
			
		||||
        "//visibility:public",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])  # Apache 2.0
 | 
			
		||||
 | 
			
		||||
package(default_visibility = [":friends"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,9 @@
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_native_cc_binary")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform:build_config.bzl",
 | 
			
		||||
@ -41,6 +47,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "quantization_interfaces_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-interface-decls",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = [
 | 
			
		||||
        ":friends",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = [
 | 
			
		||||
        ":friends",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_native_cc_binary")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@
 | 
			
		||||
# runtime behavior, but the majority of runtime tests should be TFLite side and
 | 
			
		||||
# invariants only verified in the converter/compiler.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,6 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = ["//visibility:public"],
 | 
			
		||||
    licenses = ["notice"],  # Apache 2.0
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,9 @@
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_gen_op_wrapper_py", "tf_native_cc_binary")
 | 
			
		||||
 | 
			
		||||
@ -45,6 +51,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_op_interfaces_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-interface-decls",
 | 
			
		||||
@ -65,6 +72,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_struct_doc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-dialect-doc",
 | 
			
		||||
@ -109,6 +117,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_all_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -128,6 +137,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_tfrt_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -160,6 +170,7 @@ tf_ops_category_list = [
 | 
			
		||||
[[
 | 
			
		||||
    gentbl(
 | 
			
		||||
        name = "tensorflow_" + target["name"] + "_inc_gen",
 | 
			
		||||
        compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
        tbl_outs = [
 | 
			
		||||
            (
 | 
			
		||||
                "-gen-op-decls -op-include-regex='" + target["include"] + "'",
 | 
			
		||||
@ -180,6 +191,7 @@ tf_ops_category_list = [
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_remaining_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls -op-exclude-regex='" + "|".join([target["include"] for target in tf_ops_category_list]) + "' ",
 | 
			
		||||
@ -199,6 +211,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tf_saved_model_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -225,6 +238,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_executor_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -251,6 +265,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_device_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls ",
 | 
			
		||||
@ -276,6 +291,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_canonicalize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -291,6 +307,7 @@ gentbl(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "hlo_legalize_tf_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-rewriters", "transforms/generated_legalize_hlo.inc"),
 | 
			
		||||
    ],
 | 
			
		||||
@ -639,6 +656,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "decompose_resource_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -671,6 +689,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tf_data_optimization_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -1529,6 +1548,7 @@ tf_native_cc_binary(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "derived_attr_populator_inc",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("", "translate/derived_attr_populator.inc"),
 | 
			
		||||
    ],
 | 
			
		||||
@ -1555,6 +1575,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tensorflow_optimize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
@ -1720,6 +1741,7 @@ cc_library(
 | 
			
		||||
tf_gen_op_wrapper_py(
 | 
			
		||||
    name = "gen_mlir_passthrough_op_py",
 | 
			
		||||
    out = "gen_mlir_passthrough_op.py",
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [":mlir_passthrough_op"],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -1729,6 +1751,7 @@ tf_gen_op_wrapper_py(
 | 
			
		||||
# without linking any of the other tensorflow passes.
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "lower_tf_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow:tensorflow.bzl",
 | 
			
		||||
    "tf_copts",
 | 
			
		||||
@ -19,7 +20,6 @@ tf_cuda_library(
 | 
			
		||||
    srcs = [
 | 
			
		||||
        "c_api_unified_experimental_mlir.cc",
 | 
			
		||||
    ],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    copts = tf_copts(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/c:c_api",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model:build_defs.bzl", "tf_saved_model_test")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,9 @@
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary")
 | 
			
		||||
 | 
			
		||||
@ -16,6 +22,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tfjs_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-op-decls",
 | 
			
		||||
@ -70,6 +77,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tfjs_optimize_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        (
 | 
			
		||||
            "-gen-rewriters",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
licenses(["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow:tensorflow.bzl",
 | 
			
		||||
    "tf_cc_binary",
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,6 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = ["//tensorflow/compiler/mlir/tools/kernel_gen:friends"],
 | 
			
		||||
@ -7,6 +9,7 @@ package(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "tf_framework_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "tf_framework_ops.h.inc"),
 | 
			
		||||
        ("-gen-op-defs", "tf_framework_ops.cc.inc"),
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform/default:cuda_build_defs.bzl",
 | 
			
		||||
@ -7,6 +8,7 @@ load(
 | 
			
		||||
    "@local_config_rocm//rocm:build_defs.bzl",
 | 
			
		||||
    "if_rocm_is_configured",
 | 
			
		||||
)
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = ["//tensorflow/compiler/mlir/tools/kernel_gen:friends"],
 | 
			
		||||
@ -60,6 +62,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "kernel_gen_passes_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [("-gen-pass-decls -name KernelGen", "kernel_gen_passes.h.inc")],
 | 
			
		||||
    tblgen = "@llvm-project//mlir:mlir-tblgen",
 | 
			
		||||
    td_file = "passes.td",
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,7 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test", "tf_native_cc_binary")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
    default_visibility = [":friends"],
 | 
			
		||||
@ -28,6 +30,7 @@ package_group(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "xla_legalize_tf_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-rewriters", "transforms/generated_legalize_tf.inc"),
 | 
			
		||||
    ],
 | 
			
		||||
@ -373,6 +376,7 @@ tf_native_cc_binary(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "operator_writer_inc",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [("", "operator_writers.inc")],
 | 
			
		||||
    tblgen = ":operator_writer_gen",
 | 
			
		||||
    td_file = "//tensorflow/compiler/mlir/hlo:include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td",
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/compiler/mlir:glob_lit_test.bzl", "glob_lit_tests")
 | 
			
		||||
 | 
			
		||||
package(licenses = ["notice"])
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "cuda_py_test")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")  # buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow/compiler/aot:tfcompile.bzl", "tf_library")
 | 
			
		||||
 | 
			
		||||
@ -3,13 +3,13 @@
 | 
			
		||||
#   and provide TensorRT operators and converter package.
 | 
			
		||||
#   APIs are meant to change over time.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow:tensorflow.bzl",
 | 
			
		||||
    "tf_cc_test",
 | 
			
		||||
    "tf_copts",
 | 
			
		||||
    "tf_cuda_library",
 | 
			
		||||
    "tf_custom_op_library_additional_deps",
 | 
			
		||||
    "tf_gen_op_libs",
 | 
			
		||||
    "tf_gen_op_wrapper_py",
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,9 @@ load("//tensorflow:tensorflow.bzl", "tf_custom_op_py_library")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "pybind_extension")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_gen_op_libs")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform:build_config.bzl",
 | 
			
		||||
    "tf_additional_all_protos",
 | 
			
		||||
@ -107,7 +110,6 @@ cc_library(
 | 
			
		||||
        ":common_utils",
 | 
			
		||||
        "@com_google_absl//absl/memory",
 | 
			
		||||
        "@com_google_absl//absl/strings",
 | 
			
		||||
        "@local_config_cuda//cuda:cuda_headers",
 | 
			
		||||
        "//tensorflow/core:framework",
 | 
			
		||||
        "//tensorflow/core:gpu_headers_lib",
 | 
			
		||||
        "//tensorflow/core:lib",
 | 
			
		||||
@ -118,7 +120,10 @@ cc_library(
 | 
			
		||||
        "//tensorflow/core/common_runtime:core_cpu_lib_no_ops",
 | 
			
		||||
        "//tensorflow/core/grappler/costs:graph_properties",
 | 
			
		||||
        "//tensorflow/stream_executor/lib",
 | 
			
		||||
    ] + if_tensorrt([":tensorrt_lib"]) + tf_custom_op_library_additional_deps(),
 | 
			
		||||
    ] + if_tensorrt([
 | 
			
		||||
        ":tensorrt_lib",
 | 
			
		||||
        "@local_config_cuda//cuda:cuda_headers",
 | 
			
		||||
    ]) + tf_custom_op_library_additional_deps(),
 | 
			
		||||
    alwayslink = 1,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -234,7 +239,6 @@ tf_cuda_library(
 | 
			
		||||
    name = "trt_engine_utils",
 | 
			
		||||
    srcs = ["utils/trt_engine_utils.cc"],
 | 
			
		||||
    hdrs = ["utils/trt_engine_utils.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":trt_logging",
 | 
			
		||||
        ":utils",
 | 
			
		||||
@ -249,7 +253,6 @@ tf_cuda_library(
 | 
			
		||||
    name = "trt_logging",
 | 
			
		||||
    srcs = ["utils/trt_logger.cc"],
 | 
			
		||||
    hdrs = ["utils/trt_logger.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":common_utils",
 | 
			
		||||
@ -291,7 +294,6 @@ tf_cuda_library(
 | 
			
		||||
        "utils/trt_lru_cache.h",
 | 
			
		||||
        "utils/trt_shape_optimization_profiles.h",
 | 
			
		||||
    ],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":trt_allocator",
 | 
			
		||||
        ":trt_logging",
 | 
			
		||||
@ -309,7 +311,6 @@ tf_cuda_library(
 | 
			
		||||
    name = "trt_allocator",
 | 
			
		||||
    srcs = ["utils/trt_allocator.cc"],
 | 
			
		||||
    hdrs = ["utils/trt_allocator.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/core:framework_headers_lib",
 | 
			
		||||
        "//tensorflow/core:framework_lite",
 | 
			
		||||
@ -369,7 +370,6 @@ tf_cuda_library(
 | 
			
		||||
    hdrs = [
 | 
			
		||||
        "convert/logger_registry.h",
 | 
			
		||||
    ],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    copts = tf_copts(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        "@com_google_absl//absl/strings",
 | 
			
		||||
@ -390,7 +390,6 @@ tf_cuda_library(
 | 
			
		||||
        "convert/convert_nodes.h",
 | 
			
		||||
        "convert/trt_optimization_pass.h",
 | 
			
		||||
    ],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":common_utils",
 | 
			
		||||
        ":logger_registry",
 | 
			
		||||
@ -549,7 +548,6 @@ tf_cuda_library(
 | 
			
		||||
    name = "trt_plugins",
 | 
			
		||||
    srcs = ["plugin/trt_plugin.cc"],
 | 
			
		||||
    hdrs = ["plugin/trt_plugin.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/core:framework_lite",
 | 
			
		||||
        "//tensorflow/core:lib_proto_parsing",
 | 
			
		||||
 | 
			
		||||
@ -170,7 +170,6 @@ cc_library(
 | 
			
		||||
    name = "mlir_tf2xla",
 | 
			
		||||
    srcs = ["mlir_tf2xla.cc"],
 | 
			
		||||
    hdrs = ["tf2xla.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":tf2xla_proto_cc",
 | 
			
		||||
@ -880,7 +879,6 @@ cc_library(
 | 
			
		||||
    name = "mlir_bridge_pass",
 | 
			
		||||
    srcs = ["mlir_bridge_pass.cc"],
 | 
			
		||||
    hdrs = ["mlir_bridge_pass.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/compiler/jit:flags",
 | 
			
		||||
        "//tensorflow/compiler/mlir:mlir_graph_optimization_pass",
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,9 @@ load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "internal_hlo_deps")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "internal_cuda_deps")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform/default:cuda_build_defs.bzl",
 | 
			
		||||
    "if_cuda_is_configured",
 | 
			
		||||
@ -1018,7 +1021,6 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "cpu_plugin",
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":service",
 | 
			
		||||
        "//tensorflow/compiler/xla/service/cpu:cpu_compiler",
 | 
			
		||||
@ -1038,7 +1040,6 @@ config_setting(
 | 
			
		||||
# GPU plugin should be used or not.
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "gpu_plugin",
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = select(
 | 
			
		||||
        {
 | 
			
		||||
            ":with_mlir_gpu_support": [
 | 
			
		||||
@ -1053,7 +1054,6 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "gpu_plugin_no_mlir",
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":service",
 | 
			
		||||
        "//tensorflow/compiler/xla/service/gpu:gpu_compiler",
 | 
			
		||||
@ -1065,19 +1065,18 @@ cc_library(
 | 
			
		||||
    ]) + if_rocm_is_configured([
 | 
			
		||||
        "//tensorflow/compiler/xla/service/gpu:amdgpu_compiler",
 | 
			
		||||
        "//tensorflow/core/platform/default/build_config:stream_executor_rocm",
 | 
			
		||||
    ]),
 | 
			
		||||
    ]) + internal_cuda_deps(),
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "gpu_plugin_mlir",
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":service",
 | 
			
		||||
        "//tensorflow/compiler/xla/service/gpu:gpu_transfer_manager",
 | 
			
		||||
        "//tensorflow/core:stream_executor_no_cuda",
 | 
			
		||||
    ] + if_cuda_is_configured([
 | 
			
		||||
        "//tensorflow/compiler/xla/service/mlir_gpu:mlir_compiler_impl",
 | 
			
		||||
    ]),
 | 
			
		||||
    ]) + internal_cuda_deps(),
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
cc_library(
 | 
			
		||||
@ -1198,7 +1197,6 @@ cc_library(
 | 
			
		||||
    name = "llvm_compiler",
 | 
			
		||||
    srcs = ["llvm_compiler.cc"],
 | 
			
		||||
    hdrs = ["llvm_compiler.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":compiler",
 | 
			
		||||
        "//tensorflow/core:lib_internal",
 | 
			
		||||
@ -4108,7 +4106,6 @@ cc_library(
 | 
			
		||||
    name = "elemental_ir_emitter",
 | 
			
		||||
    srcs = ["elemental_ir_emitter.cc"],
 | 
			
		||||
    hdrs = ["elemental_ir_emitter.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":hlo",
 | 
			
		||||
        ":hlo_casting_utils",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#    LLVM-based CPU backend for XLA.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow/compiler/xla:xla.bzl", "ORC_JIT_MEMORY_MAPPER_TARGETS")
 | 
			
		||||
load(
 | 
			
		||||
    "//third_party/mkl:build_defs.bzl",
 | 
			
		||||
@ -9,9 +10,6 @@ load(
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test", "tf_openmp_copts")
 | 
			
		||||
load(":build_defs.bzl", "runtime_copts")
 | 
			
		||||
load("//tensorflow/core/platform:build_config.bzl", "if_llvm_system_z_available")
 | 
			
		||||
@ -749,7 +747,6 @@ cc_library(
 | 
			
		||||
    name = "runtime_single_threaded_matmul",
 | 
			
		||||
    srcs = ["runtime_single_threaded_matmul.cc"],
 | 
			
		||||
    hdrs = ["runtime_single_threaded_matmul.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    copts = runtime_copts(),
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
@ -1072,7 +1069,6 @@ cc_library(
 | 
			
		||||
    name = "orc_jit_memory_mapper",
 | 
			
		||||
    srcs = ["orc_jit_memory_mapper.cc"],
 | 
			
		||||
    hdrs = ["orc_jit_memory_mapper.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/core:lib",
 | 
			
		||||
        "@llvm-project//llvm:ExecutionEngine",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,8 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#    Tests for LLVM-based CPU backend for XLA.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#   GPU-specific components in XLA service implementation.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform:build_config.bzl",
 | 
			
		||||
    "tf_proto_library_cc",
 | 
			
		||||
@ -27,6 +28,9 @@ load(
 | 
			
		||||
    "if_cuda_is_configured",
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
 | 
			
		||||
@ -66,7 +70,6 @@ cc_library(
 | 
			
		||||
    name = "gpu_executable_run_options",
 | 
			
		||||
    srcs = ["gpu_executable_run_options.cc"],
 | 
			
		||||
    hdrs = ["gpu_executable_run_options.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/compiler/xla:statusor",
 | 
			
		||||
@ -440,7 +443,6 @@ tf_cuda_library(
 | 
			
		||||
        ["dummy_all_reduce_thunk.cc"],
 | 
			
		||||
    ),
 | 
			
		||||
    hdrs = ["nccl_all_reduce_thunk.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":buffer_allocations",
 | 
			
		||||
        ":hlo_execution_profiler",
 | 
			
		||||
@ -477,7 +479,6 @@ cc_library(
 | 
			
		||||
    hdrs = [
 | 
			
		||||
        "gpu_debug_info_manager.h",
 | 
			
		||||
    ],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/compiler/xla/service:buffer_assignment",
 | 
			
		||||
        "//tensorflow/compiler/xla/service:hlo",
 | 
			
		||||
@ -1383,7 +1384,6 @@ cc_library(
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "xfeed_queue",
 | 
			
		||||
    hdrs = ["xfeed_queue.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/core:lib",
 | 
			
		||||
        "@com_google_absl//absl/base:core_headers",
 | 
			
		||||
@ -1394,7 +1394,6 @@ cc_library(
 | 
			
		||||
    name = "infeed_manager",
 | 
			
		||||
    srcs = ["infeed_manager.cc"],
 | 
			
		||||
    hdrs = ["infeed_manager.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":xfeed_queue",
 | 
			
		||||
        "//tensorflow/compiler/xla:shape_tree",
 | 
			
		||||
@ -1409,7 +1408,6 @@ cc_library(
 | 
			
		||||
    name = "outfeed_manager",
 | 
			
		||||
    srcs = ["outfeed_manager.cc"],
 | 
			
		||||
    hdrs = ["outfeed_manager.h"],
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":xfeed_queue",
 | 
			
		||||
        "//tensorflow/compiler/xla:literal",
 | 
			
		||||
@ -1965,6 +1963,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "xla_thunks_ops_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [
 | 
			
		||||
        ("-gen-op-decls", "ir/xla_thunks_ops.h.inc"),
 | 
			
		||||
        ("-gen-op-defs", "ir/xla_thunks_ops.cc.inc"),
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,8 @@
 | 
			
		||||
# TODO(jlebar): None of these tests actually use the GPU, so they should not
 | 
			
		||||
# need to run on machines with GPUs present.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow/compiler/xla/tests:build_defs.bzl", "xla_test")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test")
 | 
			
		||||
load(
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,8 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#    Libraries for helping construct LLVM IR for XLA backends.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow:tensorflow.bzl",
 | 
			
		||||
    "tf_cc_test",
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,13 @@
 | 
			
		||||
#   MLIR-GPU-specific components in XLA service implementation.
 | 
			
		||||
 | 
			
		||||
load("//third_party/mlir:tblgen.bzl", "gentbl")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
 | 
			
		||||
# buildifier: disable=same-origin-load
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform/default:cuda_build_defs.bzl",
 | 
			
		||||
    "if_cuda_is_configured",
 | 
			
		||||
@ -162,6 +169,7 @@ cc_library(
 | 
			
		||||
 | 
			
		||||
gentbl(
 | 
			
		||||
    name = "passes_inc_gen",
 | 
			
		||||
    compatible_with = get_compatible_with_cloud(),
 | 
			
		||||
    tbl_outs = [("-gen-pass-decls -name XlaMlirGpu", "passes.h.inc")],
 | 
			
		||||
    tblgen = "@llvm-project//mlir:mlir-tblgen",
 | 
			
		||||
    td_file = "passes.td",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,8 @@
 | 
			
		||||
# Description:
 | 
			
		||||
#   MLIR-GPU-specific convolution in XLA service implementation.
 | 
			
		||||
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
 | 
			
		||||
 | 
			
		||||
package(
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
load("//tensorflow:tensorflow.bzl", "filegroup")
 | 
			
		||||
load(
 | 
			
		||||
    "//tensorflow/core/platform:build_config_root.bzl",
 | 
			
		||||
    "tf_cuda_tests_tags",
 | 
			
		||||
 | 
			
		||||
@ -184,7 +184,6 @@ cc_library(
 | 
			
		||||
tf_cc_binary(
 | 
			
		||||
    name = "local_client_aot_test_helper",
 | 
			
		||||
    srcs = ["local_client_aot_test_helper.cc"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//tensorflow/compiler/xla:types",
 | 
			
		||||
        "//tensorflow/compiler/xla:util",
 | 
			
		||||
@ -247,7 +246,6 @@ cc_library(
 | 
			
		||||
    testonly = True,
 | 
			
		||||
    srcs = ["llvm_irgen_test_base.cc"],
 | 
			
		||||
    hdrs = ["llvm_irgen_test_base.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":codegen_test_base",
 | 
			
		||||
        ":filecheck",
 | 
			
		||||
@ -275,7 +273,6 @@ cc_library(
 | 
			
		||||
    testonly = True,
 | 
			
		||||
    srcs = ["filecheck.cc"],
 | 
			
		||||
    hdrs = ["filecheck.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    data = [
 | 
			
		||||
        "@llvm-project//llvm:FileCheck",
 | 
			
		||||
    ],
 | 
			
		||||
 | 
			
		||||
@ -509,7 +509,6 @@ tf_cuda_library(
 | 
			
		||||
    name = "gpu_utils",
 | 
			
		||||
    srcs = if_cuda_or_rocm(["gpu_utils.cc"]),
 | 
			
		||||
    hdrs = ["gpu_utils.h"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":gpu_util_hdrs",
 | 
			
		||||
        "//tensorflow/core:autotuning_proto_cc",
 | 
			
		||||
@ -1485,7 +1484,6 @@ tf_kernel_library(
 | 
			
		||||
tf_kernel_library(
 | 
			
		||||
    name = "cudnn_rnn_kernels",
 | 
			
		||||
    srcs = ["cudnn_rnn_ops.cc"],
 | 
			
		||||
    compatible_with = [],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
        ":bounds_check_lib",
 | 
			
		||||
 | 
			
		||||
@ -380,6 +380,7 @@ filegroup(
 | 
			
		||||
 | 
			
		||||
cc_library(
 | 
			
		||||
    name = "mutex",
 | 
			
		||||
    compatible_with = get_compatible_with_portable(),
 | 
			
		||||
    textual_hdrs = ["mutex.h"],
 | 
			
		||||
    # TODO(b/161569340): Short-term fix. Remove this visibility rule.
 | 
			
		||||
    visibility = ["//tensorflow:__subpackages__"],
 | 
			
		||||
 | 
			
		||||
@ -934,7 +934,8 @@ def tf_gen_op_wrapper_py(
 | 
			
		||||
        generated_target_name = None,
 | 
			
		||||
        op_whitelist = [],
 | 
			
		||||
        cc_linkopts = lrt_if_needed(),
 | 
			
		||||
        api_def_srcs = []):
 | 
			
		||||
        api_def_srcs = [],
 | 
			
		||||
        compatible_with = []):
 | 
			
		||||
    _ = require_shape_functions  # Unused.
 | 
			
		||||
 | 
			
		||||
    if (hidden or hidden_file) and op_whitelist:
 | 
			
		||||
@ -995,6 +996,7 @@ def tf_gen_op_wrapper_py(
 | 
			
		||||
            exec_tools = [tool_name] + tf_binary_additional_srcs(),
 | 
			
		||||
            cmd = ("$(location " + tool_name + ") " + api_def_args_str +
 | 
			
		||||
                   " @$(location " + hidden_file + ") > $@"),
 | 
			
		||||
            compatible_with = compatible_with,
 | 
			
		||||
        )
 | 
			
		||||
    else:
 | 
			
		||||
        native.genrule(
 | 
			
		||||
@ -1005,6 +1007,7 @@ def tf_gen_op_wrapper_py(
 | 
			
		||||
            cmd = ("$(location " + tool_name + ") " + api_def_args_str + " " +
 | 
			
		||||
                   op_list_arg + " " +
 | 
			
		||||
                   ("1" if op_list_is_whitelist else "0") + " > $@"),
 | 
			
		||||
            compatible_with = compatible_with,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    # Make a py_library out of the generated python file.
 | 
			
		||||
@ -1022,6 +1025,7 @@ def tf_gen_op_wrapper_py(
 | 
			
		||||
        # creators will provide their own tf_custom_op_py_library based target
 | 
			
		||||
        # that wraps this one.
 | 
			
		||||
        tags = ["avoid_dep"],
 | 
			
		||||
        compatible_with = compatible_with,
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
# Define a bazel macro that creates cc_test for tensorflow.
 | 
			
		||||
@ -2927,3 +2931,6 @@ def internal_hlo_deps():
 | 
			
		||||
 | 
			
		||||
def internal_tfrt_deps():
 | 
			
		||||
    return []
 | 
			
		||||
 | 
			
		||||
def internal_cuda_deps():
 | 
			
		||||
    return []
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user