[IE CLDNN] Adjustment of layouts to choose optimal deconvolution (#781)
This commit is contained in:
parent
5b2ec7840a
commit
0746f47e8a
@ -753,7 +753,14 @@ layout layout_optimizer::get_expected_layout(layout const& current_layout,
|
|||||||
} else if (_optimization_attributes.b_fs_yx_fsv16_network &&
|
} else if (_optimization_attributes.b_fs_yx_fsv16_network &&
|
||||||
deconvolution_b_fs_yx_fsv16_opt(current_layout, output_or_weights_layout, prim)) {
|
deconvolution_b_fs_yx_fsv16_opt(current_layout, output_or_weights_layout, prim)) {
|
||||||
expected_tensor = current_layout.size;
|
expected_tensor = current_layout.size;
|
||||||
expected_format = cldnn::format::b_fs_yx_fsv16;
|
auto input_tensor = node.get_dependency(0).get_output_layout().size;
|
||||||
|
int input_features = input_tensor.feature[0];
|
||||||
|
int output_features = expected_tensor.feature[0];
|
||||||
|
float r = float(input_features * output_features) / (align_to(input_features, 16) * align_to(output_features, 16));
|
||||||
|
if (r > 0.5f)
|
||||||
|
expected_format = cldnn::format::b_fs_yx_fsv16;
|
||||||
|
else
|
||||||
|
expected_format = cldnn::format::bfyx;
|
||||||
}
|
}
|
||||||
return layout(expected_data_type, expected_format, expected_tensor);
|
return layout(expected_data_type, expected_format, expected_tensor);
|
||||||
}
|
}
|
||||||
|
@ -1164,11 +1164,12 @@ void program_impl::set_layout_optimizer_attributes(layout_optimizer& lo) {
|
|||||||
prim.type() != cldnn::mutable_data::type_id())
|
prim.type() != cldnn::mutable_data::type_id())
|
||||||
can_use_fsv16 = false;
|
can_use_fsv16 = false;
|
||||||
|
|
||||||
// WA to keep bfyx_f16 layout disabled for some topologies where it leads to regressions.
|
// WA to keep fsv16 layout disabled for some topologies where it leads to regressions.
|
||||||
// Detects if given crop layer is located in the very beginning of the graph.
|
// For reshape bfy*x is preferred, as fsv16 introduces extra reorders
|
||||||
if (prim.type() == cldnn::crop::type_id()) {
|
if (prim.type() == cldnn::crop::type_id()) {
|
||||||
if (!prim.get_dependencies()[0]->is_type<reorder>() || !prim.get_dependencies()[0]->get_dependencies()[0]->is_input())
|
if (prim.get_dependencies()[0]->is_type<reshape>() || prim.get_dependencies()[0]->is_type<concatenation>()) {
|
||||||
can_use_fsv16 = false;
|
can_use_fsv16 = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prim.is_in_data_flow() &&
|
if (prim.is_in_data_flow() &&
|
||||||
|
Loading…
Reference in New Issue
Block a user