Skip to content

[GPU] Fix OC-broadcast FC decompression masks - #39106

Open
e-ddykim wants to merge 1 commit into
openvinotoolkit:masterfrom
e-ddykim:gpu-fc-oc-broadcast-fix
Open

e-ddykim wants to merge 1 commit into
openvinotoolkit:masterfrom
e-ddykim:gpu-fc-oc-broadcast-fix

Conversation

@e-ddykim

Copy link
Copy Markdown
Contributor

Details:

  • Follow-up to [GPU] remove defensive handle about oc-broadcast #38934 to fix incorrect results when grouped weight decompression scales and zero points are broadcast across output channels (N > 1), while preserving the valid N=1 grouped-mask correction.
    • Restore the OC-broadcast mask for grouped scales and zero points in both oneDNN FC creation and cache loading.
    • Determine weights OC from the logical weights rank and orientation used by the matmul descriptor.
    • Retain the full grouped mask for single-OC weights, preserving the N=1 GEMM selection.
    • Restore and extend regression coverage for parameter orientations, rank-2/rank-3 inputs, fresh/imported networks, per-OC controls, and dynamic U4 N=1 cases.
    • Add public Parameter-weight graph conversion tests for both weight orientations.

Tickets:

  • 197314

AI Assistance:

  • AI assistance used: yes

Restore the OC-broadcast mask for grouped weight scales and zero points
in oneDNN FC creation and cache loading. Derive weights OC from the
logical weights rank and orientation used by the matmul descriptor.

Keep the full grouped mask for single-OC weights to preserve the N=1
GEMM path introduced by openvinotoolkit#38934 instead of reverting that correction.

Restore broadcast regression coverage and exercise both parameter
orientations, rank-2/rank-3 inputs, fresh/imported networks, and per-OC
controls. Add dynamic U4 N=1 selection guards and public Parameter-weight
conversion tests.

Validated on Arc A770: 19 new tests pass; the relevant suite has 128
passes, 76 skips, and no failures. Both restored OCL tests pass on UHD 770.
The broadcast tests fail against the upstream FC object, and both N=1
selection guards fail against the parent FC object with ocl:ref:any.

Pre-existing rank-2 scale-only broadcast and non-transposed U4 compilation
issues remain out of scope. Kernel selection was checked, not latency.
@e-ddykim
e-ddykim requested review from a team as code owners October 22, 2026 12:32
@github-actions github-actions Bot added category: GPU OpenVINO GPU plugin category: transformations OpenVINO Runtime library - Transformations labels Oct 22, 2026
@Kotomi-Du

Copy link
Copy Markdown
Contributor

@e-ddykim may I ask why we need to address this? do we really have such case in real scenario? The standard weight-compression flow (NNCF/optimum) always produces per-OC scale/zp [N, G, 1], which ConvertFullyConnectedToFullyConnectedCompressed reshapes to [N, G], so the scale/zp OC dim always matches the weights' N.

@sungeunk sungeunk 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.

LGTM

@e-ddykim

Copy link
Copy Markdown
Contributor Author

@e-ddykim may I ask why we need to address this? do we really have such case in real scenario? The standard weight-compression flow (NNCF/optimum) always produces per-OC scale/zp [N, G, 1], which ConvertFullyConnectedToFullyConnectedCompressed reshapes to [N, G], so the scale/zp OC dim always matches the weights' N.

@Kotomi-Du The reshape preserves the scale/ZP tensor’s OC dimension; it does not expand it to match the weights’ N. Therefore, [N,G,1] becomes [N,G], but [1,G,1] becomes [1,G] even when the weights have N > 1. OC broadcasting remains.

@Kotomi-Du

Kotomi-Du commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

@e-ddykim may I ask why we need to address this? do we really have such case in real scenario? The standard weight-compression flow (NNCF/optimum) always produces per-OC scale/zp [N, G, 1], which ConvertFullyConnectedToFullyConnectedCompressed reshapes to [N, G], so the scale/zp OC dim always matches the weights' N.

@Kotomi-Du The reshape preserves the scale/ZP tensor’s OC dimension; it does not expand it to match the weights’ N. Therefore, [N,G,1] becomes [N,G], but [1,G,1] becomes [1,G] even when the weights have N > 1. OC broadcasting remains.

do we really have such real scenario? What I observed is oneDNN doesn't have such optimized kernel and will use ocl:ref:any which is very slow. Based on this observation, shall we address the broadcast in transformation stage to get better performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: GPU OpenVINO GPU plugin category: transformations OpenVINO Runtime library - Transformations do not merge do_not_merge do-not-merge Do not merge this PR under_perf_check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants