Skip to content

[GPU] Add ReduceFCDimensions transformation#36212

Open
mdvoretc-intel wants to merge 5 commits into
openvinotoolkit:masterfrom
mdvoretc-intel:fc_reduce_dim
Open

[GPU] Add ReduceFCDimensions transformation#36212
mdvoretc-intel wants to merge 5 commits into
openvinotoolkit:masterfrom
mdvoretc-intel:fc_reduce_dim

Conversation

@mdvoretc-intel
Copy link
Copy Markdown
Contributor

Details:

  • This patch adds a ReduceFCDimensions transformation that converts 4D FullyConnected inputs to 3D when the leading dimension is a static 1
  • An equivalent transformation previously contained in ConvertWeightCompressedConv1x1ToMatmul is removed, with the new transformation pass being more general
  • The transformation improves dynamic shape performance by satisfying conditions for OCL implementation pre-selection, allowing necessary weights swizzling to be done in compile time

Tickets:

AI Assistance:

  • AI assistance used: no

@mdvoretc-intel mdvoretc-intel requested review from a team as code owners June 3, 2026 13:26
@github-actions github-actions Bot added category: GPU OpenVINO GPU plugin category: transformations OpenVINO Runtime library - Transformations labels Jun 3, 2026
@sys-openvino-ci sys-openvino-ci added the ExternalIntelPR External contributor from Intel label Jun 3, 2026

auto act_pshape = activations->get_output_partial_shape(0);
auto squeeze_const =
std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{3}, std::vector<int64_t>{1, -1, act_pshape[-1].get_length()});
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.

Just in case, it's better to check that act_pshape[-1] is not dynamic and skip transformation instead of throwing an error (the same applies to shape_out[-1])

}

// If the activation has a static leading dimension of 1, squeeze it.
// This is done to allow pre-selection of OCL implementations for non-IMMAD devices, reducing memory pressure.
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.

Judging by the comment, this change is only useful for non-IMMAD devices, does it make sense in the supports_immad case?
If not, then transformations_pipeline.cpp contains information about device, and transformation may be disabled in this case

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 ExternalIntelPR External contributor from Intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants