[IE CLDNN] Disable extended eltwise fusing on gen12 (#5584)

This commit is contained in:
Paul Youngsoo Ahn 2021-05-12 22:00:12 +09:00 committed by GitHub
parent fe5ca28b6e
commit ed4d3fc4ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View File

@ -355,6 +355,7 @@ void prepare_primitive_fusing::fuse_simple_primitives(program_impl &p) {
bool recalc_processing_order = false;
std::map<primitive_id, std::vector<primitive_id>> fusing_history;
const uint8_t supports_immad = p.get_engine().get_device_info().supports_immad;
auto itr = p.get_processing_order().begin();
while (itr != p.get_processing_order().end()) {
auto node_itr = itr++;
@ -520,7 +521,7 @@ void prepare_primitive_fusing::fuse_simple_primitives(program_impl &p) {
// find original dependency of current_node using fusing_history
// and check the number of users of it.
// If the node has multiple users it's not fusible.
if (input_data.has_fused_primitives()) {
if (!supports_immad && input_data.has_fused_primitives()) {
size_t num_original_dependencies = 0;
auto iter = fusing_history.find(current_node_id);
if (iter != fusing_history.end()) {
@ -872,7 +873,7 @@ void prepare_primitive_fusing::fuse_simple_primitives(program_impl &p) {
bool merge_allowed = true;
// If fused node is not convolution and fused node has multiple users,
// follow the legacy checking rule
if (fused_node->is_type<convolution>() && fused_node->get_users().size() > 1) {
if (!supports_immad && fused_node->is_type<convolution>() && fused_node->get_users().size() > 1) {
// Allowed new pattern: Elt1, Act, Elt2, Elt3, Elt4 are fused to Conv1
// * Conv1 -> Eltw1(Add) -> Act(Clamp) -> Eltw2(Mul) -> Eltw3(Mul) -> Eltw4(Add) -> Conv2
// * \----------------------------------->/ \---------> Eltw5(Div)

View File

@ -833,9 +833,12 @@ INSTANTIATE_TEST_CASE_P(fusings_gpu, conv_fp32_prelu_eltwise,
bc_test_params{CASE_CONV_FP16_4, 2, 4},
}), );
class conv_fp32_multi_eltwise_2 : public ConvFusingTest {};
TEST_P(conv_fp32_multi_eltwise_2, basic) {
if (engine.get_info().supports_immad) {
return;
}
auto p = GetParam();
create_topologies(input_layout("input", get_input_layout(p)),
data("eltwise_data", get_mem(get_output_layout(p))),
@ -866,10 +869,12 @@ INSTANTIATE_TEST_CASE_P(fusings_gpu, conv_fp32_multi_eltwise_2,
class conv_fp32_multi_eltwise_2_clamp : public ConvFusingTest {};
TEST_P(conv_fp32_multi_eltwise_2_clamp, basic) {
auto p = GetParam();
if (engine.get_info().supports_immad) {
return;
}
auto p = GetParam();
create_topologies(input_layout("input", get_input_layout(p)),
data("eltwise1_data", get_mem(get_output_layout(p))),
data("bias", get_mem(get_bias_layout(p))),
@ -900,10 +905,12 @@ INSTANTIATE_TEST_CASE_P(fusings_gpu, conv_fp32_multi_eltwise_2_clamp,
class conv_fp32_multi_eltwise_4_clamp : public ConvFusingTest {};
TEST_P(conv_fp32_multi_eltwise_4_clamp, basic) {
auto p = GetParam();
if (engine.get_info().supports_immad) {
return;
}
auto p = GetParam();
create_topologies(input_layout("input", get_input_layout(p)),
data("eltwise1_data", get_mem(get_output_layout(p))),
data("eltwise2_data", get_mem(get_output_layout(p))),
@ -939,6 +946,10 @@ INSTANTIATE_TEST_CASE_P(fusings_gpu, conv_fp32_multi_eltwise_4_clamp,
class conv_fp32_multi_eltwise_3_fusing : public ConvFusingTest {};
TEST_P(conv_fp32_multi_eltwise_3_fusing, basic) {
if (engine.get_info().supports_immad) {
return;
}
auto p = GetParam();
create_topologies(input_layout("input", get_input_layout(p)),
data("eltwise_data1", get_mem(get_output_layout(p))),
@ -988,6 +999,7 @@ TEST_P(conv_fp32_multi_eltwise_quantization, basic) {
eltwise("eltwise2", "eltwise1", "quantize", eltwise_mode::prod),
reorder("reorder_bfyx", "eltwise2", p.default_format, data_types::f32)
);
tolerance = 1.f;
execute(p);
}