From 93b2d09a2dd9998c2bdbe965bc5ce3f97f158508 Mon Sep 17 00:00:00 2001 From: Cavus Mustafa Date: Tue, 29 Jul 2025 18:17:14 -0700 Subject: [PATCH] mulmat type conversion update --- ggml/src/ggml-openvino/openvino/op/mulmat.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp index 6905777a09..9148a27517 100644 --- a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp +++ b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp @@ -30,10 +30,13 @@ OutputVector translate_mulmat(const NodeContext& context) { ov::Output res; ov::Output B = context.get_input(0); ov::Output A = context.get_input(1); + + bool convert_out_type = false; 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)); + convert_out_type = true; } auto B_shape = context.get_input_shape(0).to_shape(); @@ -68,7 +71,12 @@ OutputVector translate_mulmat(const NodeContext& context) { A = Z; } - res = std::make_shared(A, B, false, true); + if (convert_out_type) { + auto result_lp = std::make_shared(A, B, false, true); + res = std::make_shared(result_lp, context.get_output_type(0)); + } else { + res = std::make_shared(A, B, false, true); + } return rename_outputs_with_suffix({res}, context.get_name()); }