From b14b49d5f6aaa704835d4f5eb2d8060dbf5d232f Mon Sep 17 00:00:00 2001 From: zhanmyz Date: Tue, 11 Mar 2025 15:16:40 +0800 Subject: [PATCH] Minor Update --- ggml/src/ggml-openvino.cpp | 12 ++++++------ ggml/src/ggml-openvino/ggml-decoder.cpp | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ggml/src/ggml-openvino.cpp b/ggml/src/ggml-openvino.cpp index 679b030dfa..4608019d9f 100644 --- a/ggml/src/ggml-openvino.cpp +++ b/ggml/src/ggml-openvino.cpp @@ -813,7 +813,7 @@ void ggml_backend_openvino_dup_bytes(struct ggml_tensor *dst) { auto order_const = ov::op::v0::Constant::create(ov::element::i64, {order.size()}, order); auto transpose = std::make_shared(input_param, order_const); - ov::Shape target_shape = { dst->ne[2], dst->ne[1], dst->ne[0] }; // {1, 7, 3072} + ov::Shape target_shape = { static_cast(dst->ne[2]), static_cast(dst->ne[1]), static_cast(dst->ne[0]) }; // {1, 7, 3072} std::vector target_shape_vec = { static_cast(dst->ne[2]), static_cast(dst->ne[1]), static_cast(dst->ne[0]) }; @@ -866,7 +866,7 @@ void ggml_backend_openvino_cpy(struct ggml_tensor *dst) { std::shared_ptr model; if (ggml_is_contiguous(dst)) { // Contiguous Case: Flatten src and reshape to dst shape - ov::Shape flattened_shape = {ggml_nelements(src0)}; + ov::Shape flattened_shape = {static_cast(ggml_nelements(src0))}; auto flatten = std::make_shared( src_input, ov::op::v0::Constant::create(ov::element::i64, {1}, flattened_shape), false); @@ -1013,12 +1013,12 @@ static enum ggml_status ggml_backend_openvino_graph_compute(ggml_backend_t backe // } else { for (int i = 0; i < cgraph->n_nodes; i++) { - if (std::find(permute_indices.begin(), permute_indices.end(), i) != permute_indices.end()) { - ggml_backend_openvino_permute(cgraph->nodes[i]); + if (std::find(view_indices.begin(), view_indices.end(), i) != view_indices.end()) { + ggml_backend_openvino_view(cgraph->nodes[i]); // } else if (std::find(mul_mat_indices.begin(), mul_mat_indices.end(), i) != mul_mat_indices.end()) { // ggml_backend_openvino_mul_mat(cgraph->nodes[i]); - } else if (std::find(view_indices.begin(), view_indices.end(), i) != view_indices.end()) { - ggml_backend_openvino_view(cgraph->nodes[i]); + // } else if (std::find(permute_indices.begin(), permute_indices.end(), i) != permute_indices.end()) { + // ggml_backend_openvino_permute(cgraph->nodes[i]); // } else if (std::find(cont_indices.begin(), cont_indices.end(), i) != cont_indices.end()) { // ggml_backend_openvino_dup_bytes(cgraph->nodes[i]); // } else if (std::find(transpose_indices.begin(), transpose_indices.end(), i) != transpose_indices.end()) { diff --git a/ggml/src/ggml-openvino/ggml-decoder.cpp b/ggml/src/ggml-openvino/ggml-decoder.cpp index 218c53f09f..55a82b0580 100644 --- a/ggml/src/ggml-openvino/ggml-decoder.cpp +++ b/ggml/src/ggml-openvino/ggml-decoder.cpp @@ -231,7 +231,7 @@ void ggml_graph_op_print(const struct ggml_cgraph * cgraph) { file << "n_nodes = " << cgraph->n_nodes << "\n"; file << " " << std::setw(3) << "nodes" << std::setw(15) << "shape" - << std::setw(16) << "op" + << std::setw(20) << "op" << std::setw(20) << "name" << std::setw(3) << " " << std::setw(50) << "stride" @@ -242,21 +242,24 @@ void ggml_graph_op_print(const struct ggml_cgraph * cgraph) { file << " - " << std::setw(3) << i << ": [ " << std::setw(5) << node->ne[0] << ", " << std::setw(5) << node->ne[1] << ", " - << std::setw(5) << node->ne[2] << "] " + << std::setw(5) << node->ne[2] << ", " + << std::setw(5) << node->ne[3] << "] " << std::left << std::setw(20) << ggml_op_name(node->op) << std::right << " " << std::left << std::setw(44) << node->name << std::right << ((node->flags & GGML_TENSOR_FLAG_PARAM) ? "x" : node->grad ? "g" : " ") << std::setw(2) << "[ " << std::setw(0) << node->nb[0] << ", " << std::setw(5) << node->nb[1] << ", " - << std::setw(5) << node->nb[2] << "] " + << std::setw(5) << node->nb[2] << ", " + << std::setw(5) << node->nb[3] << "] " << "\n"; if (node->src[0]) { file << std::setw(10) << " [ " << std::setw(5) << node->src[0]->ne[0] << ", " << std::setw(5) << node->src[0]->ne[1] << ", " - << std::setw(5) << node->src[0]->ne[2] << "] " + << std::setw(5) << node->src[0]->ne[2] << ", " + << std::setw(5) << node->src[0]->ne[3] << "] " << std::setw(12) << "0: " << std::left << std::setw(12) << ggml_op_name(node->src[0]->op) << std::right; // // Custom logic to handle '\000' @@ -269,14 +272,16 @@ void ggml_graph_op_print(const struct ggml_cgraph * cgraph) { << std::setw(16) << "[ " << std::setw(0) << node->src[0]->nb[0] << ", " << std::setw(5) << node->src[0]->nb[1] << ", " - << std::setw(5) << node->src[0]->nb[2] << "] " + << std::setw(5) << node->src[0]->nb[2] << ", " + << std::setw(5) << node->src[0]->nb[3] << "] " << "\n"; } if (node->src[1]) { file << std::setw(10) << " [ " << std::setw(5) << node->src[1]->ne[0] << ", " << std::setw(5) << node->src[1]->ne[1] << ", " - << std::setw(5) << node->src[1]->ne[2] << "] " + << std::setw(5) << node->src[1]->ne[2] << ", " + << std::setw(5) << node->src[1]->ne[3] << "] " << std::setw(12) << "1: " << std::left << std::setw(12) << ggml_op_name(node->src[1]->op) << std::right; // // Custom logic to handle '\000' @@ -289,7 +294,8 @@ void ggml_graph_op_print(const struct ggml_cgraph * cgraph) { << std::setw(16) << "[ " << std::setw(0) << node->src[1]->nb[0] << ", " << std::setw(5) << node->src[1]->nb[1] << ", " - << std::setw(5) << node->src[1]->nb[2] << "] " + << std::setw(5) << node->src[1]->nb[2] << ", " + << std::setw(5) << node->src[1]->nb[3] << "] " << "\n"; } }