Skip to content

Commit

Permalink
#4197: Fix tests that use assert instead of throw
Browse files Browse the repository at this point in the history
Assert can go away w/ release builds leading to unused var warnings.
  • Loading branch information
pgkeller committed Dec 6, 2023
1 parent f708f89 commit 1bcc573
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ operation::ProgramWithCallbacks moreh_layernorm_impl(
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_rows_per_core = num_rows_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges.");
TT_THROW("Core not in specified core ranges.");
}

const std::vector<uint32_t> reader_runtime_args{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ operation::ProgramWithCallbacks moreh_layernorm_backward_gamma_beta_grad_impl(
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_cols_per_core = num_cols_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges.");
TT_THROW("Core not in specified core ranges.");
}

const std::vector<uint32_t> reader_runtime_args{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ operation::ProgramWithCallbacks moreh_layernorm_backward_input_grad_impl(
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_rows_per_core = num_rows_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges.");
TT_THROW("Core not in specified core ranges.");
}

const std::vector<uint32_t> reader_runtime_args{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ operation::ProgramWithCallbacks moreh_matmul_multi_core(
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_output_tiles_per_core = num_output_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

tt_metal::SetRuntimeArgs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ operation::ProgramWithCallbacks moreh_sum_multi_core(const Tensor &src, const Te
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_cols_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges.");
TT_THROW("Core not in specified core ranges.");
}

SetRuntimeArgs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ operation::ProgramWithCallbacks moreh_softmax_c_large(const Tensor &input, Tenso
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

vector<uint32_t> reader_args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ operation::ProgramWithCallbacks moreh_softmax_h_large(const Tensor &input, Tenso
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ operation::ProgramWithCallbacks moreh_softmax_h_small(const Tensor &input, Tenso
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ operation::ProgramWithCallbacks moreh_softmax_w_large(const Tensor &input, Tenso
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ operation::ProgramWithCallbacks moreh_softmax_w_small(const Tensor &input, Tenso
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ operation::ProgramWithCallbacks moreh_softmax_backward_c_large(const Tensor &out
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

vector<uint32_t> reader_args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ operation::ProgramWithCallbacks moreh_softmax_backward_h_large(const Tensor &out
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ operation::ProgramWithCallbacks moreh_softmax_backward_h_small(const Tensor &out
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ operation::ProgramWithCallbacks moreh_softmax_backward_w_large(const Tensor &out
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ operation::ProgramWithCallbacks moreh_softmax_backward_w_small(const Tensor &out
} else if (core_group_2.core_coord_in_core_ranges(core)) {
num_tiles_per_core = num_tiles_per_core_group_2;
} else {
TT_ASSERT(false, "Core not in specified core ranges");
TT_THROW("Core not in specified core ranges");
}

float scaler = 1.0f;
Expand Down

0 comments on commit 1bcc573

Please sign in to comment.