Skip to content

Commit

Permalink
#13058: update matmul bias size validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bbradelTT committed Sep 25, 2024
1 parent 27c52d2 commit 0f2618d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,13 @@ void Matmul::validate(
uint32_t bias_batch_size = get_batch_size(bias_shape);
TT_FATAL(bias_batch_size == 1, "Unsupported bias shape: batch size not equal to 1.");
TT_FATAL(
bias_shape.with_tile_padding()[-2] == in0_tile_shape[0], "Unsupported bias shape: second last dimension not equal to tile height");
bias_shape.with_tile_padding()[-2] == in0_tile_shape[0], "Unsupported bias shape: padded second last dimension of bias, {}, not equal to tile height, {}", bias_shape.with_tile_padding()[-2], in0_tile_shape[0]);
TT_FATAL(
bias_shape.with_tile_padding()[-1] == b_shape.with_tile_padding()[-1],
"Unsupported bias shape: last dimension not equal to second input's last dimension.", bias_shape.with_tile_padding()[-1], b_shape.with_tile_padding()[-1]);
"Unsupported bias shape: padded last dimension of bias, {}, not equal to second input's padded last dimension, {}.", bias_shape.with_tile_padding()[-1], b_shape.with_tile_padding()[-1]);
TT_FATAL(
bias_shape[-1] >= b_shape[-1],
"Unsupported bias shape: last dimension of bias, {}, not equal to or greater than second input's last dimension, {}.", bias_shape[-1], b_shape[-1]);
}

if (this->untilize_out) {
Expand Down

0 comments on commit 0f2618d

Please sign in to comment.