Skip to content

[TRANSFORMATIONS] Removed optional shape verification in FuseGroupedQueryIntoGDN #36740

Open
mryzhov wants to merge 3 commits into
openvinotoolkit:masterfrom
mryzhov:qga_gdn_fix
Open

[TRANSFORMATIONS] Removed optional shape verification in FuseGroupedQueryIntoGDN #36740
mryzhov wants to merge 3 commits into
openvinotoolkit:masterfrom
mryzhov:qga_gdn_fix

Conversation

@mryzhov

@mryzhov mryzhov commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Details:

Removed additional shape verification that was blocking GQA fusion, since the initial shapes may differ from the final ones after fusion. Added a regression test.

Tickets:

AI Assistance:

  • AI assistance used: yes
  • test development

@mryzhov mryzhov requested a review from a team as a code owner July 6, 2026 14:52
@mryzhov mryzhov requested a review from Copilot July 6, 2026 14:52
@github-actions github-actions Bot added the category: transformations OpenVINO Runtime library - Transformations label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the FuseGroupedQueryIntoGDN transformation to no longer block fusion when Q/K “head count” differs from the GDN reference input shape (common in GQA-style graphs), and adds a regression test to cover the scenario.

Changes:

  • Removed a post-Reshape partial-shape compatibility check inside align_to_reference_shape that prevented grouped-query fusion.
  • Added a new regression test that builds a Q/K head-expansion pattern (via Gather) and validates that fusion is applied.
  • Added the missing VariadicSplit header in the test to support the new test model.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/common/transformations/src/transformations/common_optimizations/fuse_gated_delta_net.cpp Broadens fusion eligibility by removing a strict shape-compatibility guard in align_to_reference_shape.
src/common/transformations/tests/common_optimizations/fuse_gated_delta_net.cpp Adds a grouped-query head-expansion regression test case to ensure the fusion triggers.

Comment on lines 444 to 447
auto reshaped = std::make_shared<v1::Reshape>(src, updated_shape, false);
if (!reshaped->get_output_partial_shape(0).compatible(ref_ps)) {
return {};
}

ov::copy_runtime_info(src.get_node_shared_ptr(), {ref_shape, updated_shape, reshaped});
return reshaped;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: transformations OpenVINO Runtime library - Transformations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants