diff --git a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp index 52d1e575db..aa230550a4 100644 --- a/ggml/src/ggml-openvino/openvino/op/mulmat.cpp +++ b/ggml/src/ggml-openvino/openvino/op/mulmat.cpp @@ -28,7 +28,17 @@ OutputVector translate_mulmat(const NodeContext& context) { ov::Output res; ov::Output B = context.get_input(0); - ov::Output A = std::make_shared(context.get_input(1), context.get_input_type(0)); + ov::Output A = context.get_input(1); + if (context.get_op_case() == 1) { + if (context.get_input_type(0) == ov::element::f16) { + B = std::make_shared(context.get_input(0), ov::element::f32); + } + if (context.get_input_type(1) == ov::element::f16) { + A = std::make_shared(context.get_input(1), ov::element::f32); + } + } else { + A = std::make_shared(context.get_input(1), context.get_input_type(0)); + } auto B_shape = context.get_input_shape(0).to_shape(); auto A_shape = context.get_input_shape(1).to_shape(); diff --git a/ggml/src/ggml-openvino/openvino/translate_session.cpp b/ggml/src/ggml-openvino/openvino/translate_session.cpp index 83581ec5a8..563613aa7f 100644 --- a/ggml/src/ggml-openvino/openvino/translate_session.cpp +++ b/ggml/src/ggml-openvino/openvino/translate_session.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "ggml-openvino/openvino/node_context.hpp" #include "ggml-openvino/openvino/utils.hpp" @@ -258,6 +259,7 @@ void TranslateSession::apply_transformations(const std::shared_ptr& model ov::pass::Manager manager; manager.set_per_pass_validation(true); + manager.register_pass(); manager.register_pass(); if (!ggml_model_decoder->is_static()) {