Skip to content

Commit

Permalink
Print layout info in verifier in some more places
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 720224712
  • Loading branch information
Google-ML-Automation committed Jan 27, 2025
1 parent d3236dd commit 28ea822
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions xla/service/hlo_verifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 28ea822

Please sign in to comment.