Skip to content

Commit

Permalink
Revert "Reshape only in row major layout (#687)"
Browse files Browse the repository at this point in the history
This reverts commit 8152560.
  • Loading branch information
topke011 committed Sep 16, 2024
1 parent 8152560 commit 8ce1364
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 52 deletions.
9 changes: 1 addition & 8 deletions runtime/lib/ttnn/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,14 +710,7 @@ vectorToArray(const std::vector<int32_t> &vec) {
template <int32_t Rank>
static ::ttnn::Tensor invoke_reshape(const ::ttnn::Tensor &tensor,
const std::vector<int32_t> &shape) {
// TDOO #686 - figure out how to call reshape in tile layout
if (tensor.get_layout() == ::ttnn::Layout::ROW_MAJOR) {
return ::ttnn::reshape(tensor, vectorToArray<Rank>(shape));
}

auto rowMajorTensor = untilize(tensor);
auto res = ::ttnn::reshape(rowMajorTensor, vectorToArray<Rank>(shape));
return tilize(res);
return ::ttnn::reshape(tensor, vectorToArray<Rank>(shape));
}

static void run(::tt::target::ttnn::ReshapeOp const *op,
Expand Down
10 changes: 0 additions & 10 deletions test/ttmlir/Dialect/TTNN/reshape/reshape_fail_on_dims.mlir

This file was deleted.

10 changes: 0 additions & 10 deletions test/ttmlir/Dialect/TTNN/reshape/simple_reshape.mlir

This file was deleted.

10 changes: 10 additions & 0 deletions test/ttmlir/Dialect/TTNN/simple_reshape.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ttmlir-opt --ttir-to-ttnn-backend-pipeline %s| FileCheck %s
#any_device_tile = #tt.operand_constraint<dram|l1|tile|any_device_tile>
module attributes {} {
func.func @forward(%arg0: tensor<4x2x32x32xbf16>) -> tensor<2x4x32x32xbf16> {
%0 = tensor.empty() : tensor<2x4x32x32xbf16>
// CHECK: %[[C:.*]] = "ttnn.reshape"[[C:.*]]
%1 = "ttir.reshape"(%arg0, %0) <{shape = [2: i32, 4: i32, 32: i32, 32: i32] , operand_constraints = [#any_device_tile, #any_device_tile]}> : (tensor<4x2x32x32xbf16>, tensor<2x4x32x32xbf16>) -> tensor<2x4x32x32xbf16>
return %1 : tensor<2x4x32x32xbf16>
}
}
12 changes: 0 additions & 12 deletions test/ttmlir/Silicon/TTNN/reshape/reshape_tile_aligned.mlir

This file was deleted.

12 changes: 0 additions & 12 deletions test/ttmlir/Silicon/TTNN/reshape/simple_reshape.mlir

This file was deleted.

0 comments on commit 8ce1364

Please sign in to comment.