diff --git a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp index 57fd476f0a..6905777a09 100644 --- a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp +++ b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "../node_context.hpp" @@ -29,8 +30,10 @@ OutputVector translate_mulmat(const NodeContext& context) { ov::Output res; ov::Output B = context.get_input(0); ov::Output A = context.get_input(1); - if (context.get_input_type(0) != context.get_input_type(1)) { + if (ov::op::util::is_constant(B.get_node()) && context.get_input_type(0) != context.get_input_type(1)) { B = std::make_shared(context.get_input(0), context.get_input_type(1)); + } else if (context.get_input_type(0) != context.get_input_type(1)) { + A = std::make_shared(context.get_input(1), context.get_input_type(0)); } auto B_shape = context.get_input_shape(0).to_shape();