Fix test-backend-ops
This commit is contained in:
parent
839f8c66a0
commit
f4123be967
|
|
@ -272,7 +272,7 @@ ov::PartialShape GgmlOvDecoder::get_graph_input_shape(const ggml_tensor* src) co
|
|||
input_shape = ov::PartialShape{m_context_size, m_num_heads_kv, m_head_size};
|
||||
} else if (name.find("cache_v") == 0) {
|
||||
input_shape = ov::PartialShape{m_num_heads_kv, m_head_size, m_context_size};
|
||||
} else if (const auto* op = get_tensor_used_op(src); op->op == GGML_OP_SET_ROWS) {
|
||||
} else if (const auto* op = get_tensor_used_op(src); op && op->op == GGML_OP_SET_ROWS) {
|
||||
input_shape = ov::PartialShape{1, 1, -1};
|
||||
if (m_is_static) {
|
||||
if (m_is_first_token) {
|
||||
|
|
@ -324,6 +324,9 @@ void GgmlOvDecoder::add_extra_inputs() {
|
|||
}
|
||||
|
||||
const ggml_tensor* GgmlOvDecoder::get_tensor_used_op(const ggml_tensor* tensor) const {
|
||||
if (tensor == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
for (int i = 0; i < m_cgraph->n_nodes; i++) {
|
||||
const auto* node = m_cgraph->nodes[i];
|
||||
for (int j = 0; j < GGML_MAX_SRC; j++) {
|
||||
|
|
@ -332,7 +335,7 @@ const ggml_tensor* GgmlOvDecoder::get_tensor_used_op(const ggml_tensor* tensor)
|
|||
}
|
||||
}
|
||||
}
|
||||
throw std::runtime_error("Tensor not found in cgraph");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ggml_tensor* GgmlOvDecoder::get_tensor_from_name(const std::string& name) const {
|
||||
|
|
|
|||
|
|
@ -238,6 +238,10 @@ static ggml_backend_buffer_t ggml_backend_openvino_device_buffer_from_host_ptr(g
|
|||
|
||||
static bool is_op_unsupported_case(const ggml_tensor* op) {
|
||||
if (op->op == GGML_OP_SOFT_MAX) {
|
||||
if (op->src[2] != nullptr) {
|
||||
GGML_LOG_WARN("OpenVINO backend does not support SOFT_MAX with sinks\n");
|
||||
return true;
|
||||
}
|
||||
float scale = 1.0f;
|
||||
float max_bias = 0.0f;
|
||||
const auto* op_params = op->op_params;
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ ov::Tensor get_ov_input_tensor(std::shared_ptr<GgmlOvDecoder> ggml_decoder, cons
|
|||
}
|
||||
|
||||
} else if (const auto* op = ggml_decoder->get_tensor_used_op(ggml_decoder->get_tensor_from_name(param_name));
|
||||
op->op == GGML_OP_SET_ROWS && is_static && is_first_token) {
|
||||
op && op->op == GGML_OP_SET_ROWS && is_static && is_first_token) {
|
||||
input_tensor = ov::Tensor(ov::element::i64, ov::Shape{1});
|
||||
} else {
|
||||
input_tensor = convert_ggml_input_to_ov(ggml_decoder, param_name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue