Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sminakov-tt committed Dec 12, 2024
1 parent 0e4dc4f commit 5c5e7e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ttnn/cpp/ttnn/operations/core/to_layout/to_layout_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ inline bool use_multicore_device_tilize(

bool requires_padding_change(const ttnn::Tensor& tensor, ttnn::Layout layout) {
auto tile = tensor.get_tensor_spec().tile();
TensorSpec upd_spec(
tensor.logical_shape(),
if (layout == Layout::ROW_MAJOR) {
// There shouldn't be extra paddings for Row Major layout
return tensor.logical_shape() != tensor.padded_shape();
}
// It's okay for conversion to tile layout to preserve arbitrary padding as long as it satisfies the alignment
TensorSpec padded_spec(
tensor.padded_shape(),
TensorLayout(tensor.dtype(), PageConfig(layout, std::move(tile)), tensor.memory_config()));
return tensor.get_padded_shape().volume() != upd_spec.padded_shape().volume();
return tensor.get_padded_shape() != padded_spec.padded_shape();
}

template <typename T>
Expand Down

0 comments on commit 5c5e7e3

Please sign in to comment.