openvino
fb313778 - [GPU] Prevent converting MatMul to FC when rank_a less than rank_b (#35702)

Commit
20 days ago
[GPU] Prevent converting MatMul to FC when rank_a less than rank_b (#35702) ## Issue - Crashed with `std::bad_alloc` during graph compilation on immad-capable devices when MatMul is converted to FullyConnected. - The error occurs with MatMul having `activation[4096,4096] x weights[1,3,4096,1]`. ```cpp [ ERROR ] Exception from src/inference/src/cpp/core.cpp:117: Exception from src/inference/src/dev/plugin.cpp:54: Check 'false' failed at src/plugins/intel_gpu/src/plugin/program_builder.cpp:165: [GPU] ProgramBuilder build failed! Check 'shape_type == shape_types::dynamic_shape || node->selected_impl != nullptr' failed at src/plugins/intel_gpu/src/graph/graph_optimizer/compile_graph.cpp:51: [GPU] Failed to select implementation for name:fullyconnected:MatMul_1944 type: fully_connected original_type: FullyConnected std::bad_alloc ``` ## Root cause - oneDNN FullyConnected impl expects `input_rank >= weights_rank`. - When `input_rank(2) < weights_rank(4)`, the primitive descriptor creation fails because it cannot properly handle the rank mismatch. ## Graphs <img width="912" height="770" alt="image" src="https://github.com/user-attachments/assets/d6a430eb-5d34-4022-b103-e5e6576f09bc" /> ## Solution - Reject MatMul to FC conversion when `input_rank < weights_rank`. - The transformation now returns false early for such cases, allowing fallback to MatMul/GEMM which handles these rank configurations correctly. ## Tickets - CVS-185095
Parents
Loading