Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] Add a 3D weight check for fully_connected calc_output_layout (#35279)

Mikhail Dvoretckii9bb4cf85e6e6
diff --git a/src/plugins/intel_gpu/src/graph/fully_connected.cpp b/src/plugins/intel_gpu/src/graph/fully_connected.cpp
index 38d4e149efd..c69163668bd 100644
--- a/src/plugins/intel_gpu/src/graph/fully_connected.cpp
+++ b/src/plugins/intel_gpu/src/graph/fully_connected.cpp
@@ -130,7 +130,12 @@ layout fully_connected_inst::calc_output_layout(fully_connected_node const& node
}
if (weights_pshape.size() != 2) {
- weights_layout.set_partial_shape(reshape_to_2d(weights_pshape, feature));
+ // Detect 3D weights being passed to oneDNN
+ if (supports_immad && weights_pshape.size() == 4 && weights_layout.batch() > 1 && weights_layout.spatial(1) == feature) {
+ return calc_output_layouts<ov::PartialShape>(node, impl_param)[0];
+ } else {
+ weights_layout.set_partial_shape(reshape_to_2d(weights_pshape, feature));
+ }
}
if (supports_immad) {