Skip to content

Commit

Permalink
revert reshape optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
marty1885 committed Nov 15, 2024
1 parent e393452 commit b8f902a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ggml/src/ggml-metalium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ggml-metalium

10 changes: 2 additions & 8 deletions ggml/src/ggml-metalium/ggml-metalium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,8 @@ static std::shared_ptr<tt::tt_metal::Tensor> realize_ggml_view_impl(const ggml_t
ttnn::SimpleShape start{0, 0, 0, offset_elements};
auto dst_volume = ggml_nelements(tensor);
ttnn::SimpleShape end({1, 1, 1, uint32_t(dst_volume) + offset_elements});
tt::tt_metal::Tensor res;
if(offset_elements == 0) {
res = reshape_tt_tensor_into_ggml(*parent, tensor);
}
else {
auto t = ttnn::untilize(*parent).cpu().unpad(start, end);
res = reshape_host_tt_tensor_into_ggml(t, parent->device(), tensor);
}
auto t = ttnn::untilize(*parent).cpu().unpad(start, end);
res = reshape_host_tt_tensor_into_ggml(t, parent->device(), tensor);
}
// The fast path, this is what TTNN is designed for
else if(dst_size[0] % tt::constants::TILE_WIDTH == 0 && dst_size[1] % tt::constants::TILE_HEIGHT == 0 &&
Expand Down

0 comments on commit b8f902a

Please sign in to comment.