Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU] Avoid to select b_fs_yx_fsv2 in onednn find_data_format because the format does not have valid format_tag #25784

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ static std::shared_ptr<dnnl::convolution_forward::primitive_desc> get_convolutio
auto weights_md = onednn::layout_to_memory_desc(weights_layout, dnnl::memory::format_tag::any);
auto output_md = onednn::layout_to_memory_desc(output_layout, tag_in_out);

OPENVINO_ASSERT(!input_md.is_zero(),
"[GPU] The input memory descriptor of onednn convolution should not have zero dim.");
OPENVINO_ASSERT(!weights_md.is_zero(),
"[GPU] The weights memory descriptor of onednn convolution should not have zero dim.");
OPENVINO_ASSERT(!output_md.is_zero(),
"[GPU] The output memory descriptor of onednn convolution should not have zero dim.");

// adjust_conv_dilation_pad(dilation, stride, pad_l, pad_r, input_md, output_md, weights_md, grouped_weights);
for (size_t i = 0; i < dilation.size(); i++) {
dilation[i]--;
Expand Down
10 changes: 8 additions & 2 deletions src/plugins/intel_gpu/src/graph/impls/onednn/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,14 @@ cldnn::format find_data_format(dnnl::memory::desc desc) {
break;
}
}
if (is_match)
return static_cast<format::type>(fmt_idx);

if (is_match) {
// b_fs_yx_fsv2 has dnnl::memory::format_tag::undef , so select byfx instead of b_fs_yx_fsv2.
if (static_cast<format::type>(fmt_idx) == format::type::b_fs_yx_fsv2)
return format::type::byxf;
else
return static_cast<format::type>(fmt_idx);
}
isanghao marked this conversation as resolved.
Show resolved Hide resolved
}
}

isanghao marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading