[TRANSFORMATIONS] Removed optional shape verification in FuseGroupedQueryIntoGDN #36740
Open
mryzhov wants to merge 3 commits into
Open
[TRANSFORMATIONS] Removed optional shape verification in FuseGroupedQueryIntoGDN #36740mryzhov wants to merge 3 commits into
mryzhov wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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-
Reshapepartial-shape compatibility check insidealign_to_reference_shapethat 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
VariadicSplitheader 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; |
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.
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: