Add fun description

This commit is contained in:
Xuejun Zhai 2026-03-15 23:31:27 -07:00 committed by Mustafa Cavus
parent eb5dc53a82
commit a528765b7d
2 changed files with 8 additions and 0 deletions

View File

@ -472,6 +472,9 @@ enum ggml_status ov_graph_compute_static(ggml_cgraph * cgraph, std::shared_ptr<o
return GGML_STATUS_SUCCESS;
}
// Detect whether a cgraph is a split subgraph or not.
// Step 1 compares each node's recorded use_count with actual fan-out references in node->src.
// Step 2 verifies that node inputs come from model nodes/weights/leafs; external sources imply split.
bool is_model_splitted(ggml_cgraph * cgraph) {
// check the nodes of the model are used by the following nodes, through compare the node's use count and the count of nodes that use it as input. If does not match, return true, else return false.
for (int i = 0; i < cgraph->n_nodes; i++) {

View File

@ -117,6 +117,11 @@ ov::Tensor create_ov_output_tensor(std::shared_ptr<GgmlOvDecoder> ggml_decoder,
bool is_naive(struct ggml_cgraph * cgraph);
/**
* @brief Heuristically checks whether the given computation graph is a split-model fragment.
* @param cgraph Pointer to the GGML computation graph to analyze.
* @return true if the graph is identified as split; otherwise false.
*/
bool is_model_splitted(struct ggml_cgraph * cgraph);
enum ggml_status naive_compute(struct ggml_cgraph * cgraph,