[GPU] Block the fc horizontal fusion for weights that are not constants#36572
Merged
e-ddykim merged 1 commit intoJun 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Intel GPU plugin’s FullyConnectedHorizontalFusion transformation to avoid fusing horizontal FC patterns when FC weights are not compile-time constants, addressing weight-sharing scenarios where weights become runtime Parameters and would otherwise force an unfused Concat into GPU program build (and/or cause per-inference overhead).
Changes:
- Add a guard in the horizontal-fusion pattern predicate to require FC weight inputs to be constant (or constant-derived) before allowing fusion.
- Add unit tests covering weights-as-Parameters and Convert(Parameter) weight forms to ensure fusion is blocked in these cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/plugins/intel_gpu/src/plugin/transformations/fc_horizontal_fusion.cpp |
Blocks horizontal FC fusion when weight input is not constant, preventing unfused runtime Concat and avoiding per-inference concatenation overhead. |
src/plugins/intel_gpu/tests/unit/transformations/horizontal_fc_fusion_test.cpp |
Adds regression tests ensuring no fusion occurs when weights are provided as Parameter (including Convert(Parameter)). |
intbf
force-pushed
the
block_fc_horiz_fusion_for_inputs
branch
from
June 25, 2026 17:58
1c5f36e to
2a9cccf
Compare
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:
Found when using weight sharing with llms. In that case weights are converted into inputs/parameters, and the fusion might not work as expected. With inputs/parameters the constant folding won't happen, so the fusion will be invoked on every inference. Plus in some cases the concat operator might not be enabled for all weight types (like int4)
Tickets:
CVS-189072
AI Assistance: