Skip to content

Fix CONT/TRANSPOSE mapping and enhance dynamic dimension handling#117

Merged
wine99 merged 1 commit intoravi9:dev_backend_openvinofrom
zhaixuejun1993:xuejun/enable-cont-op
Mar 26, 2026
Merged

Fix CONT/TRANSPOSE mapping and enhance dynamic dimension handling#117
wine99 merged 1 commit intoravi9:dev_backend_openvinofrom
zhaixuejun1993:xuejun/enable-cont-op

Conversation

@zhaixuejun1993
Copy link
Copy Markdown
Collaborator

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 CONT and TRANSPOSE, improve stride and dynamic dimension handling, and enhance backend support checks.

Key improvements and changes:

Operation Handling and Refactoring

  • Refactored the handling of the GGML_OP_CONT operation in compute_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]
  • Updated the GGML_OP_MUL_MAT case in compute_op_case to remove dependency on CONT-TRANSPOSE patterns, focusing on VIEW-based cases.
  • Improved the logic for determining attention size in compute_llm_params to handle cases where a TRANSPOSE follows a PERMUTE and VIEW, ensuring correct parameter extraction.

Dynamic Dimensions and Stride Support

  • Added new virtual methods and implementations for retrieving output stride and dynamic dimension information (get_output_stride, get_op_dynamic_dim) in GgmlDecoder and GgmlOvDecoder, and exposed them in NodeContext. This enables more flexible and accurate handling of tensor layouts and dynamic shapes. [1] [2] [3] [4] [5]
  • Enhanced the translate_transpose function 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

  • Added a check to mark GGML_OP_TRANSPOSE as unsupported for BF16 tensors, improving error handling and backend compatibility.
  • Re-enabled support for the GGML_OP_CONT operation in the set of supported operations for the OpenVINO backend.

Utilities and Miscellaneous

  • Updated the model splitting utility to handle graphs consisting solely of TRANSPOSE or PERMUTE nodes, preventing incorrect model splitting in these cases.…on handling

Overview

Additional information

Requirements

@wine99 wine99 merged commit ca1bd05 into ravi9:dev_backend_openvino Mar 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants