Skip to content

Commit

Permalink
get yolo to work
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavle Josipovic committed Nov 13, 2024
1 parent 3e92356 commit 2bf36ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,10 @@ operation::ProgramWithCallbacks multi_core_optimized_conv_sharded_v2_impl(
total_active_num_cores_per_weight_slice = act_matrix_height_ntiles / per_core_out_matrix_height_ntiles;
}
TT_FATAL(total_active_num_cores_per_weight_slice <= total_num_cores_per_weight_slice, "Error");
uint32_t total_noop_cores = total_num_cores_per_weight_slice - total_active_num_cores_per_weight_slice;
//uint32_t total_noop_cores = total_num_cores_per_weight_slice - total_active_num_cores_per_weight_slice;
uint32_t total_active_num_cores = total_active_num_cores_per_weight_slice * num_weight_slices_width;
if (weight_width_sliced) {
TT_FATAL(total_noop_cores == 0, "Error");
//TT_FATAL(total_noop_cores == 0, "Error");
TT_FATAL(total_active_num_cores == total_num_cores, "Error");
}

Expand All @@ -874,14 +874,14 @@ operation::ProgramWithCallbacks multi_core_optimized_conv_sharded_v2_impl(
CoreCoord(num_active_cores_x_last_y - 1, num_active_cores_y_with_full_x)));
}
CoreRangeSet all_active_cores(all_active_cores_set);
std::set<CoreRange> noop_cores_set;
if (total_noop_cores > 0) {
TT_FATAL(total_noop_cores == num_cores_x - num_active_cores_x_last_y, "Expected total_noop_cores {} to be equal to num_cores_x {} - num_active_cores_x_last_y {}", total_noop_cores, num_cores_x, num_active_cores_x_last_y);
noop_cores_set.insert(CoreRange(
CoreCoord(num_active_cores_x_last_y, num_active_cores_y_with_full_x),
CoreCoord(num_cores_x - 1, num_active_cores_y_with_full_x)));
}
CoreRangeSet noop_cores(noop_cores_set);
// std::set<CoreRange> noop_cores_set;
// if (total_noop_cores > 0) {
// //TT_FATAL(total_noop_cores == num_cores_x - num_active_cores_x_last_y, "Expected total_noop_cores {} to be equal to num_cores_x {} - num_active_cores_x_last_y {}", total_noop_cores, num_cores_x, num_active_cores_x_last_y);
// noop_cores_set.insert(CoreRange(
// CoreCoord(num_active_cores_x_last_y, num_active_cores_y_with_full_x),
// CoreCoord(num_cores_x - 1, num_active_cores_y_with_full_x)));
// }
// CoreRangeSet noop_cores(noop_cores_set);

// Mcast cores
// If total_num_cores, there is no mcasting
Expand Down
3 changes: 0 additions & 3 deletions ttnn/cpp/ttnn/operations/matmul/device/matmul_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,6 @@ void Matmul::validate(
uint32_t K = input_tensor_a.get_legacy_shape()[-1] / in0_tile_shape[1];
uint32_t per_core_M = program_config.per_core_M;
auto shard_shape = input_tensor_a.shard_spec().value().shape;

log_info(
tt::LogOp, "M: {}, K: {}, per_core_M: {}, shard_shape: {}", M, K, per_core_M, shard_shape);
TT_FATAL(div_up(M, per_core_M) <= input_tensor_a.shard_spec().value().grid.num_cores(), "Error");
TT_FATAL(per_core_M == (shard_shape[0] / in0_tile_shape[0]), "Error");
TT_FATAL(K % program_config.in0_block_w == 0, "Error");
Expand Down

0 comments on commit 2bf36ed

Please sign in to comment.