From 0f2618dd0b2fea49dcf736e7379ae570464c5057 Mon Sep 17 00:00:00 2001 From: Borys Bradel Date: Wed, 25 Sep 2024 13:51:18 +0000 Subject: [PATCH] #13058: update matmul bias size validation --- ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp b/ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp index 89fcec4c24ff..6a91ad1d6c0d 100644 --- a/ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp +++ b/ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp @@ -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) {