[OpenVINO backend] add func is_splited_model()#20626
Closed
zhaixuejun1993 wants to merge 7 commits intoggml-org:masterfrom
Closed
[OpenVINO backend] add func is_splited_model()#20626zhaixuejun1993 wants to merge 7 commits intoggml-org:masterfrom
zhaixuejun1993 wants to merge 7 commits intoggml-org:masterfrom
Conversation
| // 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) { |
Contributor
There was a problem hiding this comment.
I was wondering if we can detect if the graph is split in ggml-openvino.cpp when detecting supported/unsupported ops and then we can write this information into runtime context?
Member
There was a problem hiding this comment.
Generally no - checking for supported ops can happen at various stages, depending on what the user code (e.g. llama.cpp) does. Basically, the backend should never be aware if a graph is split or not.
I assume you need some workaround logic to get the test suite rolling. That would be OK. In the long term, this logic should not be needed.
…GGML graph in api compute_model_outputs()
Contributor
Author
|
in dev repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for detecting and handling split-model computation graphs within the OpenVINO GGML decoder. The changes add a new mechanism to identify whether a computation graph is a split fragment and propagate this information through the decoder interface, will be used in fallback PATH.
Detection and handling of split-model graphs:
is_model_splittedfunction to heuristically determine if aggml_cgraphrepresents a split-model fragment, with detailed checks for node usage and input sources. [1] [2]ov_graph_compute_dynamicto avoid naive computation for split-model graphs by integrating the new detection function.GgmlOvDecoderinstances to pass the split-model flag, ensuring downstream components are aware of the graph's split status. [1] [2] [3]ov_graph_compute_staticto correctly set the split-model and prefill flags when creating decoder instances.Decoder interface enhancements:
is_splited_modelvirtual method to the decoder interface and implemented it inGgmlOvDecoder, along with the new member variablem_model_is_splitted. [1] [2] [3]