Skip to content

Commit

Permalink
#0: Fix L1 alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
sankarmanoj-tt committed Dec 24, 2024
1 parent b03a6b2 commit 63456b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion tt_metal/impl/program/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ uint32_t detail::Program_::get_cb_memory_size() const{
total_cb_size += circular_buffer->size();

}
log_info("Total CB Size : {}", total_cb_size);
return total_cb_size;
}

Expand Down
14 changes: 8 additions & 6 deletions ttnn/cpp/ttnn/operations/conv/conv2d/conv2d_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1138,12 +1138,13 @@ std::pair<uint32_t,uint32_t> conv2d::estimate_L1_usage(
if(use_non_tile_height){
// uint32_t total_height = conv_output_h * conv_output_w * batch_size;
// output_size = total_height / pconfig.num_cores_nhw * output_channels;
output_size = pconfig.per_core_out_matrix_width * pconfig.per_core_out_matrix_height;
uint32_t per_core_out_width_aligned = pconfig.per_core_out_matrix_width;
if(output_dtype == DataType::BFLOAT16) {
output_size *= 2;
per_core_out_width_aligned *= 2;
} else if(output_dtype == DataType::FLOAT32) {
output_size *= 4;
per_core_out_width_aligned *= 4;
}
output_size = round_up(per_core_out_width_aligned, 32) * pconfig.per_core_out_matrix_height;
} else {
output_size = per_core_out_matrix_height_ntiles *
per_core_out_matrix_width_ntiles *
Expand Down Expand Up @@ -1244,12 +1245,13 @@ std::pair<uint32_t,uint32_t> conv2d::estimate_L1_usage(

uint32_t output_size = 0;
if(untilize_out) {
output_size = output_shard_shape[1] * output_shard_shape[0];
uint32_t per_core_out_width_aligned = pconfig.per_core_out_matrix_width;
if(output_dtype == DataType::BFLOAT16) {
output_size *= 2;
per_core_out_width_aligned *= 2;
} else if(output_dtype == DataType::FLOAT32) {
output_size *= 4;
per_core_out_width_aligned *= 4;
}
output_size = round_up(per_core_out_width_aligned, 32) * pconfig.per_core_out_matrix_height;
} else {
output_size = per_core_out_matrix_height_ntiles * per_core_out_matrix_width_ntiles * output_tile_size;
}
Expand Down

0 comments on commit 63456b2

Please sign in to comment.