From bdfa7080d4c38b935690507ab7cc949b977bbc55 Mon Sep 17 00:00:00 2001 From: xla authors Date: Mon, 27 Jan 2025 10:36:36 -0800 Subject: [PATCH] Print layout info in verifier in some more places PiperOrigin-RevId: 720224712 --- xla/service/hlo_verifier.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xla/service/hlo_verifier.cc b/xla/service/hlo_verifier.cc index b62ef43c92c0d5..d3bae8d7144c1a 100644 --- a/xla/service/hlo_verifier.cc +++ b/xla/service/hlo_verifier.cc @@ -1359,8 +1359,9 @@ absl::Status ShapeVerifier::HandleFusion(HloInstruction* fusion) { } } else { TF_RET_CHECK(ShapeUtil::Compatible(output_subshape, operand_subshape)) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } } return absl::OkStatus(); @@ -1440,12 +1441,14 @@ absl::Status ShapeVerifier::HandleCustomCall(HloInstruction* instruction) { custom_call->operand(pair.second.first)->shape(), pair.second.second); if (opts_.layout_sensitive) { TF_RET_CHECK(operand_subshape == output_subshape) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } else { TF_RET_CHECK(ShapeUtil::Compatible(output_subshape, operand_subshape)) - << "Different aliasing shapes: " << operand_subshape.ToString() - << " vs " << output_subshape.ToString(); + << "Different aliasing shapes: " + << operand_subshape.ToString(/*print_layout=*/true) << " vs " + << output_subshape.ToString(/*print_layout=*/true); } } return absl::OkStatus(); @@ -1660,7 +1663,8 @@ absl::Status ShapeVerifier::CheckAsyncOpComputationShapes( return Internal( "The %s expects the async shape to be a tuple of at least two " "elements, found %s.", - HloOpcodeString(async_op->opcode()), async_shape.ToString()); + HloOpcodeString(async_op->opcode()), + async_shape.ToString(/*print_layout=*/true)); } ProgramShape computation_shape =