Fix CONT/TRANSPOSE mapping and enhance dynamic dimension handling#117
Merged
wine99 merged 1 commit intoravi9:dev_backend_openvinofrom Mar 26, 2026
Merged
Conversation
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 several improvements and refactorings to the OpenVINO backend for GGML, focusing on better handling of tensor operations, dynamic dimensions, and backend compatibility. The changes streamline the logic for operations like
CONTandTRANSPOSE, improve stride and dynamic dimension handling, and enhance backend support checks.Key improvements and changes:
Operation Handling and Refactoring
GGML_OP_CONToperation incompute_op_case, removing special-cased logic and simplifying its use throughout the codebase. The logic for handling CONT now relies on dynamic dimension information instead of hardcoded cases. [1] [2]GGML_OP_MUL_MATcase incompute_op_caseto remove dependency on CONT-TRANSPOSE patterns, focusing on VIEW-based cases.compute_llm_paramsto handle cases where a TRANSPOSE follows a PERMUTE and VIEW, ensuring correct parameter extraction.Dynamic Dimensions and Stride Support
get_output_stride,get_op_dynamic_dim) inGgmlDecoderandGgmlOvDecoder, and exposed them inNodeContext. This enables more flexible and accurate handling of tensor layouts and dynamic shapes. [1] [2] [3] [4] [5]translate_transposefunction to compute the permute order dynamically based on input/output strides and shapes, making the transpose operation robust to different layouts.Backend Compatibility and Checks
GGML_OP_TRANSPOSEas unsupported for BF16 tensors, improving error handling and backend compatibility.GGML_OP_CONToperation in the set of supported operations for the OpenVINO backend.Utilities and Miscellaneous
Overview
Additional information
Requirements