[GPU] set b_fs_yx_fsv32 for first conv and dt is U8. (#14454)

* set b_fs_yx_fsv32 for first conv and dt is U8.

* check input format is bfyx.
This commit is contained in:
Sungeun Kim 2022-12-08 16:52:30 +09:00 committed by GitHub
parent 0602b852eb
commit b799e3eb91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1832,6 +1832,15 @@ void layout_optimizer::select_preferred_formats_for_onednn(program_node& node, d
node.set_preferred_input_fmt(idx, src_fmt);
auto dst_fmt = onednn::find_data_format(prim_desc.dst_desc());
// Errata: Best impl for shallow input conv with zero-point ops is ocl:xe_lp.
if (node.is_type<convolution>() && src_fmt == format::bfyx) {
auto& conv = node.as<convolution>();
if (conv.get_input_layouts()[0].feature() <= 8 && conv.activations_zero_points_term() &&
conv.get_input_layouts()[0].data_type == data_types::u8 && conv.get_output_layout().data_type == data_types::u8) {
dst_fmt = format::b_fs_yx_fsv32;
}
}
if (node.get_preferred_output_fmt() == format::any) {
for (size_t usr = 0 ; usr < node.get_users().size() ; usr++)
node.set_preferred_output_fmt(usr, dst_fmt);