[GPU] Fix FullyConnected accuracy regression for large f16 matmuls on non-immad devices#36883
Open
alvoron wants to merge 5 commits into
Open
[GPU] Fix FullyConnected accuracy regression for large f16 matmuls on non-immad devices#36883alvoron wants to merge 5 commits into
FullyConnected accuracy regression for large f16 matmuls on non-immad devices#36883alvoron wants to merge 5 commits into
Conversation
Contributor
|
@clee30 , could you please review? |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an Intel GPU plugin accuracy regression where large f16 MatMul→FullyConnected conversions could keep weights in non-transposed [K, N] layout even when the execution path uses OCL FullyConnected kernels (non-immad devices) that assume transposed weights, causing incorrect weight indexing.
Changes:
- Gate the “keep weights non-transposed for large f16 matmuls” heuristic on
supports_immad, ensuring the non-transposed layout is only selected when the oneDNN FullyConnected implementation will consume it. - Add a unit test covering the non-immad case to ensure the transformation keeps the transposed behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/plugins/intel_gpu/src/plugin/transformations/convert_matmul_to_fc.cpp | Gates the large-f16 non-transposed weights decision on supports_immad to avoid OCL FC misinterpreting weight layout. |
| src/plugins/intel_gpu/tests/unit/transformations/convert_matmul_to_fc_test.cpp | Adds a regression test ensuring non-immad devices keep the transposed weights path. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
clee30
reviewed
Jul 16, 2026
…com/alvoron/openvino into alvoron_gpu_f16_matmul_accuracy_fix
Contributor
Author
|
@maxnick could you please review? |
clee30
approved these changes
Jul 16, 2026
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:
weights_transposed(transpose_b) flag and, for large non-compressed f16 matmuls (K >= 8192 && (M <= 512 || N <= 4096)), keeps the weights in the non-transposed[K, N]layout so they can be executed with the faster onednnabcweight layout.FullyConnectedimplementation. The OCLFullyConnectedkernels always assume transposed[N, K]weights and ignore the flag - they only referenceweights_transposedfor output-shape calculation, not for weight indexing.Fix:
supports_immad, so the layout is only chosen when onednn will actually consume it. On non-immad devices the pass now keeps the previous transposed behavior.Tickets: