Skip to content

Commit

Permalink
#11838: Rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
VirdhatchaniKN committed Sep 7, 2024
1 parent 9c8ce6c commit 3802793
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "ttnn/tensor/serialization.hpp"
#include "ttnn/tensor/tensor_utils.hpp"
#include "tt_metal/common/work_split.hpp"
#include "tt_lib_bindings.hpp"
#include "tt_lib_bindings_tensor_impl.hpp"
#include "type_caster.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ std::vector<Tensor> OptimizedConv::create_output_tensors(const std::vector<Tenso
if (this->memory_config.memory_layout == TensorMemoryLayout::HEIGHT_SHARDED) {
uint32_t total_height_tiles = tt::tt_metal::compute_volume(output_shape) / output_shape[-1] / TILE_HEIGHT;
uint32_t num_cores = total_height_tiles / this->parallelization_config.per_core_out_matrix_height_ntiles;
CoreRangeSet shard_grid = tt::tt_metal:: num_cores_to_corerange_set(num_cores, this->parallelization_config.grid_size, true);
CoreRangeSet shard_grid = tt::tt_metal::num_cores_to_corerange_set(num_cores, this->parallelization_config.grid_size, true);

std::array<uint32_t, 2> shard_shape = {this->parallelization_config.per_core_out_matrix_height_ntiles * TILE_HEIGHT, output_shape[-1]};
auto shard_spec = ShardSpec{shard_grid, shard_shape, ShardOrientation::ROW_MAJOR};
Expand All @@ -206,7 +206,7 @@ std::vector<Tensor> OptimizedConv::create_output_tensors(const std::vector<Tenso
uint32_t weight_matrix_width_ntiles = weight_matrix_width / TILE_WIDTH;
uint32_t num_weight_slices_width = weight_matrix_width_ntiles / this->parallelization_config.per_core_out_matrix_width_ntiles ;
uint32_t total_active_num_cores = total_active_num_cores_per_weight_slice * num_weight_slices_width;
CoreRangeSet shard_grid = tt::tt_metal:: num_cores_to_corerange_set(total_active_num_cores, this->parallelization_config.grid_size, true);
CoreRangeSet shard_grid = tt::tt_metal::num_cores_to_corerange_set(total_active_num_cores, this->parallelization_config.grid_size, true);
std::array<uint32_t, 2> shard_shape = {this->parallelization_config.per_core_out_matrix_height_ntiles * TILE_HEIGHT, this->parallelization_config.per_core_out_matrix_width_ntiles * TILE_WIDTH};
auto shard_spec = ShardSpec{shard_grid, shard_shape, transpose_mcast ? ShardOrientation::COL_MAJOR : ShardOrientation::ROW_MAJOR};
auto mem_config = this->memory_config;
Expand Down
2 changes: 0 additions & 2 deletions ttnn/ttnn/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def is_sharded(tensor) -> bool:


get_memory_config = ttnn._ttnn.core.get_memory_config
# num_cores_to_corerange_set = ttnn._ttnn.operations.core.num_cores_to_corerange_set
# num_cores_to_core_range_set = ttnn._ttnn.operations.core.num_cores_to_core_range_set


def num_cores_to_core_range_set(
Expand Down

0 comments on commit 3802793

Please sign in to comment.