Fix tensor handling and comments for VIEW and PERMUTE ops#79
Merged
wine99 merged 4 commits intoravi9:dev_backend_openvinofrom Mar 23, 2026
Merged
Conversation
Collaborator
|
since it does not effect normal execution. you can merge after this comment is addressed. |
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 improves support for split models and handling of VIEW and PERMUTE tensor operations in the OpenVINO backend of
ggml. The changes ensure correct data reconstruction for non-contiguous tensors in split models, enhance error checking, and refine cache logic for model parameters.Split model support and tensor reconstruction:
PERMUTEandVIEWtensors in split models withinconvert_ggml_input_to_ov, ensuring non-contiguous data is correctly copied into contiguous OpenVINO tensors. This is done by iterating over all dimensions and applying strides and offsets. (ggml/src/ggml-openvino/utils.cpp, ggml/src/ggml-openvino/utils.cppL614-R652)extrafield for input tensors if the model is not split, preventing incorrect tensor handling in split models. (ggml/src/ggml-openvino/utils.cpp, ggml/src/ggml-openvino/utils.cppL601-R603)VIEWoperations to only useview_srcshape if the model is not split, maintaining correct behavior for both split and non-split models. (ggml/src/ggml-openvino/utils.cpp, ggml/src/ggml-openvino/utils.cppL614-R652)VIEW operation handling and error checking:
VIEWoperations as unsupported if the number of elements differs from their source tensor, with a clear error message for unsupported cases. (ggml/src/ggml-openvino/ggml-openvino.cpp, ggml/src/ggml-openvino/ggml-openvino.cppR912-R920)compute_op_caseto handle split models by setting the operation case to 0 for relevant input tensors, improving compatibility with split model input handling. (ggml/src/ggml-openvino/ggml-decoder.cpp, ggml/src/ggml-openvino/ggml-decoder.cppR224-R226)Cache logic refinement:
ggml/src/ggml-openvino/utils.cpp, ggml/src/ggml-openvino/utils.cppR122-R124)Make sure to read the contributing guidelines before submitting a PR