diff --git a/tensorflow/core/kernels/BUILD b/tensorflow/core/kernels/BUILD index f484ace0c8c..ea167ba35a3 100644 --- a/tensorflow/core/kernels/BUILD +++ b/tensorflow/core/kernels/BUILD @@ -16,8 +16,8 @@ load( ) load( "//tensorflow/core/kernels/mlir_generated:build_defs.bzl", + "if_mlir_experimental_kernels_enabled", "if_mlir_generated_gpu_kernels_enabled", - "if_mlir_unranked_kernels_enabled", ) # buildifier: disable=same-origin-load @@ -3347,7 +3347,7 @@ tf_kernel_library( tf_kernel_library( name = "cwise_op", copts = if_mlir_generated_gpu_kernels_enabled(if_true = ["-DMLIR_GENERATED_GPU_KERNELS_ENABLED=1"]) + - if_mlir_unranked_kernels_enabled(if_true = ["-DMLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED=1"]), + if_mlir_experimental_kernels_enabled(if_true = ["-DMLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED=1"]), prefix = "cwise_op", deps = MATH_DEPS + if_mlir_generated_gpu_kernels_enabled(if_true = ["//tensorflow/core/kernels/mlir_generated:cwise_op"]), ) diff --git a/tensorflow/core/kernels/cwise_op_add_1.cc b/tensorflow/core/kernels/cwise_op_add_1.cc index deabeb904d6..e5ef14aa5cd 100644 --- a/tensorflow/core/kernels/cwise_op_add_1.cc +++ b/tensorflow/core/kernels/cwise_op_add_1.cc @@ -25,7 +25,7 @@ REGISTER6(BinaryOp, CPU, "AddV2", functor::add, float, Eigen::half, double, REGISTER3(BinaryOp, GPU, "Add", functor::add, float, Eigen::half, double); #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(BinaryOp, GPU, "AddV2", functor::add, float, Eigen::half, double); #endif diff --git a/tensorflow/core/kernels/cwise_op_add_2.cc b/tensorflow/core/kernels/cwise_op_add_2.cc index e30055286b1..c8f36d2352b 100644 --- a/tensorflow/core/kernels/cwise_op_add_2.cc +++ b/tensorflow/core/kernels/cwise_op_add_2.cc @@ -33,7 +33,7 @@ REGISTER4(BinaryOp, GPU, "Add", functor::add, uint8, int64, complex64, complex128); #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER5(BinaryOp, GPU, "AddV2", functor::add, uint8, uint32, int64, complex64, complex128); #else diff --git a/tensorflow/core/kernels/cwise_op_bitwise_and.cc b/tensorflow/core/kernels/cwise_op_bitwise_and.cc index 21963936b05..63d47d1c1f4 100644 --- a/tensorflow/core/kernels/cwise_op_bitwise_and.cc +++ b/tensorflow/core/kernels/cwise_op_bitwise_and.cc @@ -22,7 +22,7 @@ REGISTER8(BinaryOp, CPU, "BitwiseAnd", functor::bitwise_and, int8, int16, int32, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER8(BinaryOp, GPU, "BitwiseAnd", functor::bitwise_and, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else @@ -30,7 +30,7 @@ REGISTER8(BinaryOp, GPU, "BitwiseAnd", functor::bitwise_and, int8, int16, int32, REGISTER4(BinaryOp, GPU, "BitwiseAnd", functor::bitwise_and, uint8, uint16, uint32, uint64); #endif // !MLIR_GENERATED_GPU_KERNELS_ENABLED || - // !MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED + // !MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM } // namespace tensorflow diff --git a/tensorflow/core/kernels/cwise_op_bitwise_or.cc b/tensorflow/core/kernels/cwise_op_bitwise_or.cc index 992485468c6..7457845fcc2 100644 --- a/tensorflow/core/kernels/cwise_op_bitwise_or.cc +++ b/tensorflow/core/kernels/cwise_op_bitwise_or.cc @@ -22,7 +22,7 @@ REGISTER8(BinaryOp, CPU, "BitwiseOr", functor::bitwise_or, int8, int16, int32, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER8(BinaryOp, GPU, "BitwiseOr", functor::bitwise_or, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else @@ -30,7 +30,7 @@ REGISTER8(BinaryOp, GPU, "BitwiseOr", functor::bitwise_or, int8, int16, int32, REGISTER4(BinaryOp, GPU, "BitwiseOr", functor::bitwise_or, uint8, uint16, uint32, uint64); #endif // !MLIR_GENERATED_GPU_KERNELS_ENABLED || - // !MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED + // !MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM } // namespace tensorflow diff --git a/tensorflow/core/kernels/cwise_op_bitwise_xor.cc b/tensorflow/core/kernels/cwise_op_bitwise_xor.cc index d296bd08406..0569bfed1e2 100644 --- a/tensorflow/core/kernels/cwise_op_bitwise_xor.cc +++ b/tensorflow/core/kernels/cwise_op_bitwise_xor.cc @@ -22,7 +22,7 @@ REGISTER8(BinaryOp, CPU, "BitwiseXor", functor::bitwise_xor, int8, int16, int32, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER8(BinaryOp, GPU, "BitwiseXor", functor::bitwise_xor, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else @@ -30,7 +30,7 @@ REGISTER8(BinaryOp, GPU, "BitwiseXor", functor::bitwise_xor, int8, int16, int32, REGISTER4(BinaryOp, GPU, "BitwiseXor", functor::bitwise_xor, uint8, uint16, uint32, uint64); #endif // !MLIR_GENERATED_GPU_KERNELS_ENABLED || - // !MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED + // !MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED #endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM } // namespace tensorflow diff --git a/tensorflow/core/kernels/cwise_op_ceil.cc b/tensorflow/core/kernels/cwise_op_ceil.cc index b6748eaa92b..e722b1368b8 100644 --- a/tensorflow/core/kernels/cwise_op_ceil.cc +++ b/tensorflow/core/kernels/cwise_op_ceil.cc @@ -21,7 +21,7 @@ REGISTER4(UnaryOp, CPU, "Ceil", functor::ceil, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Ceil", functor::ceil, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_conj.cc b/tensorflow/core/kernels/cwise_op_conj.cc index 5e137d63e3f..8442da1cf24 100644 --- a/tensorflow/core/kernels/cwise_op_conj.cc +++ b/tensorflow/core/kernels/cwise_op_conj.cc @@ -27,7 +27,7 @@ REGISTER_KERNEL_BUILDER( Name("Conj").Device(DEVICE_GPU).TypeConstraint("T"), UnaryVariantOp); #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_KERNEL_BUILDER( Name("Conj").Device(DEVICE_GPU).TypeConstraint("T"), UnaryOp>); diff --git a/tensorflow/core/kernels/cwise_op_cos.cc b/tensorflow/core/kernels/cwise_op_cos.cc index 5bf127f0fb8..16697c10051 100644 --- a/tensorflow/core/kernels/cwise_op_cos.cc +++ b/tensorflow/core/kernels/cwise_op_cos.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Cos", functor::cos, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Cos", functor::cos, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_equal_to_1.cc b/tensorflow/core/kernels/cwise_op_equal_to_1.cc index a3117385142..b0dfe945605 100644 --- a/tensorflow/core/kernels/cwise_op_equal_to_1.cc +++ b/tensorflow/core/kernels/cwise_op_equal_to_1.cc @@ -28,7 +28,7 @@ REGISTER_KERNEL_BUILDER( ApproximateEqualOp); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER4(BinaryOp, GPU, "Equal", functor::equal_to, float, Eigen::half, double, uint8); #else diff --git a/tensorflow/core/kernels/cwise_op_equal_to_2.cc b/tensorflow/core/kernels/cwise_op_equal_to_2.cc index 66dc6ffb7f7..95eb576ba07 100644 --- a/tensorflow/core/kernels/cwise_op_equal_to_2.cc +++ b/tensorflow/core/kernels/cwise_op_equal_to_2.cc @@ -26,7 +26,7 @@ REGISTER6(BinaryOp, CPU, "Equal", functor::equal_to, int32, int64, complex64, complex128, tstring, bool); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER6(BinaryOp, GPU, "Equal", functor::equal_to, int8, int16, int64, complex64, complex128, bool); #else diff --git a/tensorflow/core/kernels/cwise_op_exp.cc b/tensorflow/core/kernels/cwise_op_exp.cc index 24d098a0984..71833e623b6 100644 --- a/tensorflow/core/kernels/cwise_op_exp.cc +++ b/tensorflow/core/kernels/cwise_op_exp.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Exp", functor::exp, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER5(UnaryOp, GPU, "Exp", functor::exp, float, Eigen::half, double, complex64, complex128); #endif diff --git a/tensorflow/core/kernels/cwise_op_floor.cc b/tensorflow/core/kernels/cwise_op_floor.cc index 57296f9a41a..72fea66771c 100644 --- a/tensorflow/core/kernels/cwise_op_floor.cc +++ b/tensorflow/core/kernels/cwise_op_floor.cc @@ -21,7 +21,7 @@ REGISTER4(UnaryOp, CPU, "Floor", functor::floor, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Floor", functor::floor, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_gpu_left_shift.cu.cc b/tensorflow/core/kernels/cwise_op_gpu_left_shift.cu.cc index 8e453dac8c3..9305a638848 100644 --- a/tensorflow/core/kernels/cwise_op_gpu_left_shift.cu.cc +++ b/tensorflow/core/kernels/cwise_op_gpu_left_shift.cu.cc @@ -20,7 +20,7 @@ limitations under the License. namespace tensorflow { namespace functor { #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) DEFINE_BINARY8(left_shift, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else diff --git a/tensorflow/core/kernels/cwise_op_gpu_right_shift.cu.cc b/tensorflow/core/kernels/cwise_op_gpu_right_shift.cu.cc index e43fcf611e0..6c02a6f99e5 100644 --- a/tensorflow/core/kernels/cwise_op_gpu_right_shift.cu.cc +++ b/tensorflow/core/kernels/cwise_op_gpu_right_shift.cu.cc @@ -20,7 +20,7 @@ limitations under the License. namespace tensorflow { namespace functor { #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) DEFINE_BINARY8(right_shift, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else diff --git a/tensorflow/core/kernels/cwise_op_greater.cc b/tensorflow/core/kernels/cwise_op_greater.cc index e8af93c40d4..84fc4623b0d 100644 --- a/tensorflow/core/kernels/cwise_op_greater.cc +++ b/tensorflow/core/kernels/cwise_op_greater.cc @@ -20,7 +20,7 @@ REGISTER9(BinaryOp, CPU, "Greater", functor::greater, float, Eigen::half, double, int32, int64, uint8, int8, int16, bfloat16); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER7(BinaryOp, GPU, "Greater", functor::greater, float, Eigen::half, double, int64, uint8, int8, int16); #else diff --git a/tensorflow/core/kernels/cwise_op_greater_equal.cc b/tensorflow/core/kernels/cwise_op_greater_equal.cc index 5731ddc4654..0bb34a55bd9 100644 --- a/tensorflow/core/kernels/cwise_op_greater_equal.cc +++ b/tensorflow/core/kernels/cwise_op_greater_equal.cc @@ -20,7 +20,7 @@ REGISTER9(BinaryOp, CPU, "GreaterEqual", functor::greater_equal, float, Eigen::half, double, int32, int64, uint8, int8, int16, bfloat16); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER7(BinaryOp, GPU, "GreaterEqual", functor::greater_equal, float, Eigen::half, double, int64, uint8, int8, int16); #else diff --git a/tensorflow/core/kernels/cwise_op_imag.cc b/tensorflow/core/kernels/cwise_op_imag.cc index fb76ec24df0..9e34c09b936 100644 --- a/tensorflow/core/kernels/cwise_op_imag.cc +++ b/tensorflow/core/kernels/cwise_op_imag.cc @@ -28,7 +28,7 @@ REGISTER_COMPLEX(CPU, double, complex128); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_COMPLEX(GPU, float, complex64); REGISTER_COMPLEX(GPU, double, complex128); #endif diff --git a/tensorflow/core/kernels/cwise_op_isinf.cc b/tensorflow/core/kernels/cwise_op_isinf.cc index 5f5a0ac18dd..6d4777b2c1d 100644 --- a/tensorflow/core/kernels/cwise_op_isinf.cc +++ b/tensorflow/core/kernels/cwise_op_isinf.cc @@ -21,7 +21,7 @@ REGISTER4(UnaryOp, CPU, "IsInf", functor::isinf, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "IsInf", functor::isinf, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_left_shift.cc b/tensorflow/core/kernels/cwise_op_left_shift.cc index 664259e89d6..f43c46b0aef 100644 --- a/tensorflow/core/kernels/cwise_op_left_shift.cc +++ b/tensorflow/core/kernels/cwise_op_left_shift.cc @@ -22,7 +22,7 @@ REGISTER8(BinaryOp, CPU, "LeftShift", functor::left_shift, int8, int16, int32, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER8(BinaryOp, GPU, "LeftShift", functor::left_shift, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else diff --git a/tensorflow/core/kernels/cwise_op_less.cc b/tensorflow/core/kernels/cwise_op_less.cc index 53864cf4297..88193285740 100644 --- a/tensorflow/core/kernels/cwise_op_less.cc +++ b/tensorflow/core/kernels/cwise_op_less.cc @@ -22,7 +22,7 @@ REGISTER4(BinaryOp, CPU, "Less", functor::less, int64, uint8, int8, int16); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER7(BinaryOp, GPU, "Less", functor::less, float, Eigen::half, double, int64, uint8, int8, int16); #else diff --git a/tensorflow/core/kernels/cwise_op_less_equal.cc b/tensorflow/core/kernels/cwise_op_less_equal.cc index ac1cb0153d1..669b96fe904 100644 --- a/tensorflow/core/kernels/cwise_op_less_equal.cc +++ b/tensorflow/core/kernels/cwise_op_less_equal.cc @@ -23,7 +23,7 @@ REGISTER4(BinaryOp, CPU, "LessEqual", functor::less_equal, int64, uint8, int8, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER7(BinaryOp, GPU, "LessEqual", functor::less_equal, float, Eigen::half, double, int64, uint8, int8, int16); #else diff --git a/tensorflow/core/kernels/cwise_op_log.cc b/tensorflow/core/kernels/cwise_op_log.cc index f0ece6c24ca..6efce168ac4 100644 --- a/tensorflow/core/kernels/cwise_op_log.cc +++ b/tensorflow/core/kernels/cwise_op_log.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Log", functor::log, float, Eigen::half, double, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Log", functor::log, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_logical_and.cc b/tensorflow/core/kernels/cwise_op_logical_and.cc index 485f870b97b..8cd85176c1f 100644 --- a/tensorflow/core/kernels/cwise_op_logical_and.cc +++ b/tensorflow/core/kernels/cwise_op_logical_and.cc @@ -20,10 +20,10 @@ REGISTER_KERNEL_BUILDER(Name("LogicalAnd").Device(DEVICE_CPU), BinaryOp); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_KERNEL_BUILDER(Name("LogicalAnd").Device(DEVICE_GPU), BinaryOp); #endif // !MLIR_GENERATED_GPU_KERNELS_ENABLED || - // !MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED + // !MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED #endif } // namespace tensorflow diff --git a/tensorflow/core/kernels/cwise_op_logical_not.cc b/tensorflow/core/kernels/cwise_op_logical_not.cc index cd7a5cc3bd3..d38876590ce 100644 --- a/tensorflow/core/kernels/cwise_op_logical_not.cc +++ b/tensorflow/core/kernels/cwise_op_logical_not.cc @@ -20,7 +20,7 @@ REGISTER_KERNEL_BUILDER(Name("LogicalNot").Device(DEVICE_CPU), UnaryOp); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_KERNEL_BUILDER(Name("LogicalNot").Device(DEVICE_GPU), UnaryOp); #endif diff --git a/tensorflow/core/kernels/cwise_op_logical_or.cc b/tensorflow/core/kernels/cwise_op_logical_or.cc index 03e8977dc5d..052e29ab88d 100644 --- a/tensorflow/core/kernels/cwise_op_logical_or.cc +++ b/tensorflow/core/kernels/cwise_op_logical_or.cc @@ -20,10 +20,10 @@ REGISTER_KERNEL_BUILDER(Name("LogicalOr").Device(DEVICE_CPU), BinaryOp); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_KERNEL_BUILDER(Name("LogicalOr").Device(DEVICE_GPU), BinaryOp); #endif // !MLIR_GENERATED_GPU_KERNELS_ENABLED || - // !MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED + // !MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED #endif } // namespace tensorflow diff --git a/tensorflow/core/kernels/cwise_op_mul_1.cc b/tensorflow/core/kernels/cwise_op_mul_1.cc index f2b42fe5a5d..730e6c9dd3d 100644 --- a/tensorflow/core/kernels/cwise_op_mul_1.cc +++ b/tensorflow/core/kernels/cwise_op_mul_1.cc @@ -31,7 +31,7 @@ REGISTER(BinaryOp, CPU, "Mul", functor::mul, int32); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER4(BinaryOp, GPU, "Mul", functor::mul, Eigen::half, float, double, uint8); #else diff --git a/tensorflow/core/kernels/cwise_op_mul_2.cc b/tensorflow/core/kernels/cwise_op_mul_2.cc index de2628c1761..995012f9ff9 100644 --- a/tensorflow/core/kernels/cwise_op_mul_2.cc +++ b/tensorflow/core/kernels/cwise_op_mul_2.cc @@ -26,7 +26,7 @@ REGISTER6(BinaryOp, CPU, "Mul", functor::mul, int8, uint16, int16, int64, complex64, complex128); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER6(BinaryOp, GPU, "Mul", functor::mul, int8, uint16, int16, int64, complex64, complex128); #else diff --git a/tensorflow/core/kernels/cwise_op_neg_1.cc b/tensorflow/core/kernels/cwise_op_neg_1.cc index 8368ca3a3aa..9551d845e35 100644 --- a/tensorflow/core/kernels/cwise_op_neg_1.cc +++ b/tensorflow/core/kernels/cwise_op_neg_1.cc @@ -21,7 +21,7 @@ REGISTER4(UnaryOp, CPU, "Neg", functor::neg, int8, int16, int32, int64); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Neg", functor::neg, int8, int16, int64); #endif diff --git a/tensorflow/core/kernels/cwise_op_neg_2.cc b/tensorflow/core/kernels/cwise_op_neg_2.cc index 9515c2a960e..a2857fa1337 100644 --- a/tensorflow/core/kernels/cwise_op_neg_2.cc +++ b/tensorflow/core/kernels/cwise_op_neg_2.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Neg", functor::neg, Eigen::half, float, double, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER6(UnaryOp, GPU, "Neg", functor::neg, Eigen::half, float, double, bfloat16, complex64, complex128); #else diff --git a/tensorflow/core/kernels/cwise_op_not_equal_to_1.cc b/tensorflow/core/kernels/cwise_op_not_equal_to_1.cc index 4251412b415..22f30ebeccd 100644 --- a/tensorflow/core/kernels/cwise_op_not_equal_to_1.cc +++ b/tensorflow/core/kernels/cwise_op_not_equal_to_1.cc @@ -22,7 +22,7 @@ REGISTER7(BinaryOp, CPU, "NotEqual", functor::not_equal_to, uint16, uint32, uint64, qint8, qint16, quint8, quint16); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER4(BinaryOp, GPU, "NotEqual", functor::not_equal_to, float, Eigen::half, double, uint8); #else diff --git a/tensorflow/core/kernels/cwise_op_not_equal_to_2.cc b/tensorflow/core/kernels/cwise_op_not_equal_to_2.cc index f77a50d656c..dc0adc9c711 100644 --- a/tensorflow/core/kernels/cwise_op_not_equal_to_2.cc +++ b/tensorflow/core/kernels/cwise_op_not_equal_to_2.cc @@ -26,7 +26,7 @@ REGISTER6(BinaryOp, CPU, "NotEqual", functor::not_equal_to, int32, int64, complex64, complex128, tstring, bool); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER6(BinaryOp, GPU, "NotEqual", functor::not_equal_to, int8, int16, int64, complex64, complex128, bool); #else diff --git a/tensorflow/core/kernels/cwise_op_real.cc b/tensorflow/core/kernels/cwise_op_real.cc index cb8484802f0..351376875b6 100644 --- a/tensorflow/core/kernels/cwise_op_real.cc +++ b/tensorflow/core/kernels/cwise_op_real.cc @@ -29,7 +29,7 @@ REGISTER_COMPLEX(CPU, double, complex128); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER_COMPLEX(GPU, float, complex64); REGISTER_COMPLEX(GPU, double, complex128); #endif diff --git a/tensorflow/core/kernels/cwise_op_right_shift.cc b/tensorflow/core/kernels/cwise_op_right_shift.cc index 7786343d73b..b72ec4988d9 100644 --- a/tensorflow/core/kernels/cwise_op_right_shift.cc +++ b/tensorflow/core/kernels/cwise_op_right_shift.cc @@ -22,7 +22,7 @@ REGISTER8(BinaryOp, CPU, "RightShift", functor::right_shift, int8, int16, int32, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER8(BinaryOp, GPU, "RightShift", functor::right_shift, int8, int16, int32, int64, uint8, uint16, uint32, uint64); #else diff --git a/tensorflow/core/kernels/cwise_op_rsqrt.cc b/tensorflow/core/kernels/cwise_op_rsqrt.cc index cb6c1efd548..7d673887a31 100644 --- a/tensorflow/core/kernels/cwise_op_rsqrt.cc +++ b/tensorflow/core/kernels/cwise_op_rsqrt.cc @@ -21,7 +21,7 @@ REGISTER5(UnaryOp, CPU, "Rsqrt", functor::rsqrt, float, Eigen::half, double, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Rsqrt", functor::rsqrt, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_sign.cc b/tensorflow/core/kernels/cwise_op_sign.cc index 8bca0c113fe..7c1e9fb67eb 100644 --- a/tensorflow/core/kernels/cwise_op_sign.cc +++ b/tensorflow/core/kernels/cwise_op_sign.cc @@ -20,7 +20,7 @@ REGISTER8(UnaryOp, CPU, "Sign", functor::sign, float, double, int32, int64, complex64, Eigen::half, bfloat16, complex128); #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER6(UnaryOp, GPU, "Sign", functor::sign, float, Eigen::half, double, int64, complex64, complex128); #else diff --git a/tensorflow/core/kernels/cwise_op_sin.cc b/tensorflow/core/kernels/cwise_op_sin.cc index 3689f8b7399..b137e690221 100644 --- a/tensorflow/core/kernels/cwise_op_sin.cc +++ b/tensorflow/core/kernels/cwise_op_sin.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Sin", functor::sin, float, Eigen::half, bfloat16, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Sin", functor::sin, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/cwise_op_sqrt.cc b/tensorflow/core/kernels/cwise_op_sqrt.cc index 32c78e4666a..dfa0b8e8860 100644 --- a/tensorflow/core/kernels/cwise_op_sqrt.cc +++ b/tensorflow/core/kernels/cwise_op_sqrt.cc @@ -21,7 +21,7 @@ REGISTER6(UnaryOp, CPU, "Sqrt", functor::sqrt, float, Eigen::half, double, #if GOOGLE_CUDA || TENSORFLOW_USE_ROCM #if !defined(MLIR_GENERATED_GPU_KERNELS_ENABLED) || \ - !defined(MLIR_GENERATED_UNRANKED_GPU_KERNELS_ENABLED) + !defined(MLIR_GENERATED_EXPERIMENTAL_GPU_KERNELS_ENABLED) REGISTER3(UnaryOp, GPU, "Sqrt", functor::sqrt, float, Eigen::half, double); #endif #endif diff --git a/tensorflow/core/kernels/mlir_generated/BUILD b/tensorflow/core/kernels/mlir_generated/BUILD index 339046effaa..734e84f38fb 100644 --- a/tensorflow/core/kernels/mlir_generated/BUILD +++ b/tensorflow/core/kernels/mlir_generated/BUILD @@ -3,8 +3,8 @@ load( "//tensorflow/core/kernels/mlir_generated:build_defs.bzl", "gen_kernel_library", + "if_mlir_experimental_kernels_enabled", "if_mlir_generated_gpu_kernels_enabled", - "if_mlir_unranked_kernels_enabled", ) load( "//tensorflow:tensorflow.bzl", @@ -31,7 +31,7 @@ config_setting( ) config_setting( - name = "mlir_use_unranked_kernels", + name = "mlir_experimental_kernels_enabled", define_values = {"enable_unranked_kernels": "1"}, ) @@ -70,7 +70,7 @@ filegroup( name = "unary_kernel_srcs", srcs = [ ":enabled_unary_kernel_srcs", - ] + if_mlir_unranked_kernels_enabled( + ] + if_mlir_experimental_kernels_enabled( if_true = [":experimental_unary_kernel_srcs"], ), compatible_with = get_compatible_with_cloud(), @@ -182,7 +182,7 @@ tf_kernel_library( # but we want to avoid building them if they are not needed. deps = if_cuda_or_rocm([ ":cwise_unary_op", - ]) + if_mlir_unranked_kernels_enabled( + ]) + if_mlir_experimental_kernels_enabled( [ ":cwise_binary_op", ], diff --git a/tensorflow/core/kernels/mlir_generated/build_defs.bzl b/tensorflow/core/kernels/mlir_generated/build_defs.bzl index df7fcc371a7..7808d1a702a 100644 --- a/tensorflow/core/kernels/mlir_generated/build_defs.bzl +++ b/tensorflow/core/kernels/mlir_generated/build_defs.bzl @@ -77,9 +77,9 @@ def _gen_mlir_op(name, type): # Kernels build rules. ################################################################################ -def if_mlir_unranked_kernels_enabled(if_true, if_false = []): +def if_mlir_experimental_kernels_enabled(if_true, if_false = []): return select({ - "//tensorflow/core/kernels/mlir_generated:mlir_use_unranked_kernels": if_true, + "//tensorflow/core/kernels/mlir_generated:mlir_experimental_kernels_enabled": if_true, "//conditions:default": if_false, })