[GPU] Skip in-place concat when a predecessor is in a shape-of subgraph#36767
Queued
andrew-k-park wants to merge 1 commit into
Queued
[GPU] Skip in-place concat when a predecessor is in a shape-of subgraph#36767andrew-k-park wants to merge 1 commit into
andrew-k-park wants to merge 1 commit into
Conversation
concat_in_place_optimization forces offset padding on predecessor outputs, but shape-of subgraph nodes run on CPU impls that don't support padded output. When such a node (e.g. a crop lowered from VariadicSplit) feeds a concat that is itself outside the subgraph, in-place concat made the CPU crop impl assert at runtime: Check '!padded_output' failed at .../impls/cpu/crop.cpp:65: [GPU] Padded output is not supported yet The existing guard only checked concat_node.is_in_shape_of_subgraph(), which misses this case. Reject the optimization when any predecessor is in a shape-of subgraph. Adds a unit test reproducing the crash.
e-ddykim
approved these changes
Jul 8, 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.
Description of the issue (symptom, root-cause, how it was resolved)
[GPU] Padded output is not supported yetthrown fromcrop_cpu_implduring inference when a concat mixes a shape-of subgraph input with a regular one. Reproduced on GPU with a model that has a shape-of subgraph (ShapeOf -> ... -> VariadicSplit) inside aLoopbody.concat_in_place_optimizationforces offset padding on its predecessor outputs so they can write directly into the concat output buffer. Nodes inside a shape-of subgraph run on CPU impls (e.g.croplowered fromVariadicSplit) which do not support padded output. The existing guard only checkedconcat_node.is_in_shape_of_subgraph()— when the concat itself is outside the subgraph but one of its predecessors is inside it, the optimization still fired and the CPU crop impl asserted at runtime.concat_in_place_optimization::match, reject the optimization when any predecessoris_in_shape_of_subgraph(). The concat then uses an explicit (non-in-place) implementation, so no padding is forced on the CPU-impl predecessor. Behavior for non-shape-of predecessors is unchanged.The code and line that caused this issue (if it is not changed directly)
intel_gpu/src/graph/impls/cpu/crop.cpp:65OPENVINO_ASSERT(!padded_output, "[GPU] Padded output is not supported yet")— CPU crop impl cannot produce a padded output.intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cppconcat_in_place_optimization::match()— existing guard checked only the concat node, not its predecessors.Reproduction step and snapshot (if applicable. Do not attach for customer model)
Minimal graph inside a shape-of subgraph reaching the CPU crop impl:
Concatis outside the subgraph → passes the existing guard → in-place optimization forces padded output oncrop.out1→ CPU crop impl throws at runtime.Regression test:
ov_gpu_unit_tests --gtest_filter='prepare_buffer_fusing.in_place_concat_rejected_for_shape_of_subgraph_input'Problematic graph
crop1is a CPU-impl node inside the shape-of subgraph;Concatsits outside it. In-place concat makescrop1write with an offset into the shared buffer (padded output), which the CPU crop impl does not support.Checklist
prepare_buffer_fusing_test.cpp; existingin_place_concat_*tests use regular (non-shape-of) predecessors and don't exercise the CPU-impl padded-output path, so a new test was added.Tickets: