FEAT: do PERMUTE eagerly
This commit is contained in:
parent
8b408869ae
commit
6ed44a3dff
|
|
@ -43,12 +43,8 @@ void GgmlOvDecoder::set_input_output(ggml_tensor* node, std::map<std::string, gg
|
||||||
|
|
||||||
switch (node->op) {
|
switch (node->op) {
|
||||||
case GGML_OP_CONT: {
|
case GGML_OP_CONT: {
|
||||||
if (ggml_is_contiguous(node->src[0]) && ggml_is_contiguous(node) &&
|
// Currently only two cases, either the input comes from a VIEW which is subtensor or from a PERMUTE
|
||||||
(node->src[0]->ne[0] * node->src[0]->nb[0] == node->src[0]->nb[1])) {
|
m_continuous = ggml_nelements(node->src[0]) == ggml_nelements(node->src[0]->view_src);
|
||||||
m_continuous = true;
|
|
||||||
} else {
|
|
||||||
m_continuous = false;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GGML_OP_CPY: {
|
case GGML_OP_CPY: {
|
||||||
|
|
@ -183,9 +179,9 @@ GgmlOvDecoder::GgmlOvDecoder(struct ggml_tensor * node, struct ggml_cgraph * cgr
|
||||||
// Init model input and output
|
// Init model input and output
|
||||||
set_input_output(cur_node, m_inputs, m_outputs);
|
set_input_output(cur_node, m_inputs, m_outputs);
|
||||||
}
|
}
|
||||||
#ifdef GGML_OPENVINO_DEBUG
|
if (getenv("GGML_OPENVINO_DEBUG")) {
|
||||||
ggml_graph_op_print(m_cgraph);
|
ggml_graph_op_print(m_cgraph);
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue