Skip to content

Conversation

@evkotov
Copy link
Contributor

@evkotov evkotov commented Dec 2, 2025

Details:

This PR fixes shape mismatch error when converting Qwen-Image model

Root cause: ComplexTypeMark marker was lost when complex tensors passed through various operations. OpenVINO uses ComplexTypeMark to track complex tensors (represented as float tensors with trailing dimension of size 2). When the marker is lost, subsequent operations incorrectly add extra dimensions for "alignment".

Changes:

  1. ComplexTypeMarkRemover transformation - removes ComplexTypeMark nodes from final graph for models with complex tensor outputs

  2. PrimListUnpackReplacer reordering - moved to no_val block to execute before validation

  3. prim::TupleUnpack - preserve ComplexTypeMark through tuple unpacking (new translator + replacer fix)

  4. prim::ListUnpack - preserve ComplexTypeMark in else-branch for unresolved cases

  5. aten::squeeze - unwrap-operate-rewrap pattern to preserve ComplexTypeMark

  6. aten::select - unwrap-operate-rewrap pattern to preserve ComplexTypeMark

  7. aten::narrow - unwrap-operate-rewrap pattern to preserve ComplexTypeMark

  8. aten::type_as - dedicated translator using ComplexTypeMark::convert_like() instead of generic ConvertLike

Tickets:

  • 176305

…npack conversion when model has shape inference errors in other operations
Remove unnecessary formatting and refactoring changes:
- Revert blank line additions in complex_type_mark.cpp
- Revert comment fix in complex_type_mark.cpp
- Revert variable reordering in complex_type_mark.cpp
- Revert code simplification in unsqueeze.cpp

These changes were made during debugging but are not required
for the CVS-176305 fix.
@evkotov evkotov self-assigned this Dec 2, 2025
@evkotov evkotov requested a review from a team as a code owner December 2, 2025 16:47
@evkotov evkotov added the category: PyTorch FE OpenVINO PyTorch Frontend label Dec 2, 2025
@evkotov evkotov requested a review from mmikolajcz December 2, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: PyTorch FE OpenVINO PyTorch Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant