diff --git a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/BUILD b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/BUILD index 9d83f381c4b..bc28776ba78 100644 --- a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/BUILD +++ b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/BUILD @@ -253,7 +253,6 @@ cc_library( "//xla/service:hlo_module_config", "//xla/service:hlo_proto_cc", "//xla/service:source_target_pairs", - "//xla/service/gpu:backend_configs_cc", "//xla/service/spmd/shardy:constants", "//xla/service/spmd/shardy:utils", "//xla/service/spmd/shardy/stablehlo_round_trip:export_shardings", diff --git a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc index 8d225e18d57..1e0a8c0c0b3 100644 --- a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc +++ b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc @@ -105,7 +105,6 @@ limitations under the License. #include "xla/mlir_hlo/mhlo/transforms/passes.h" #include "xla/mlir_hlo/stablehlo_ext/transforms/passes.h" #include "xla/mlir_hlo/utils/unregistered_attributes.h" -#include "xla/service/gpu/backend_configs.pb.h" #include "xla/service/hlo.pb.h" #include "xla/service/hlo_module_config.h" #include "xla/service/source_target_pairs.h" @@ -4815,29 +4814,6 @@ LogicalResult ExportXlaOp(BitcastOp op, OpLoweringContext ctx) { xla::XlaOp bitcast = xla::internal::XlaBuilderFriend::BuildBitcast( ctx.builder, operand, xla::TypeToShape(op.getType())); value_map[op] = bitcast; - if (ctx.converter->GetOptions().propagate_bitcast_layouts_to_backend_config) { - // Encode the source and result layout of the bitcast into the XLA HLO - // backend config as a protobuf. Note that this is a temporary solution - // which will go away once XLA:GPU stops falling back to XLA HLO Elemental - // IR emitters. - xla::HloInstructionProto* bitcast_proto = - xla::internal::XlaBuilderFriend::GetInstruction(bitcast); - xla::HloInstructionProto* operand_proto = - xla::internal::XlaBuilderFriend::GetInstruction(operand); - xla::LayoutProto result_layout = - ExtractLayout(op, bitcast_proto->shape().dimensions_size(), - xla::kBitcastResultLayout) - .ToProto(); - xla::LayoutProto source_layout = - ExtractLayout(op, operand_proto->shape().dimensions_size(), - xla::kBitcastSourceLayout) - .ToProto(); - xla::gpu::BitcastBackendConfig bitcast_config; - *bitcast_config.mutable_source_layout() = source_layout; - *bitcast_config.mutable_result_layout() = result_layout; - *bitcast_proto->mutable_backend_config() = - bitcast_config.SerializeAsString(); - } return success(); } diff --git a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.h b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.h index 9977af5eb45..a459a6e72f1 100644 --- a/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.h +++ b/third_party/xla/xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.h @@ -44,11 +44,6 @@ struct MlirToHloConversionOptions { // TODO(timshen): Investigate the necessity of having layouts in MHLO. bool propagate_layouts = false; - // Propagate the source and result layouts from mhlo bitcast op into the - // backend config for the bitcast. This is required for XLA:GPU backend to - // use elemental IR emitters for fused bitcasts without propagating layouts. - bool propagate_bitcast_layouts_to_backend_config = false; - LayoutPreferenceFn layout_preference_fn; ShapeRepresentationFn shape_representation_fn;