Skip to content

[GPU] Fix reshape runtime padding propagation when cropped axis is dropped#35616

Merged
e-ddykim merged 1 commit intoopenvinotoolkit:masterfrom
andrew-k-park:fix_aliased_crop_reshape_outputs
May 4, 2026
Merged

[GPU] Fix reshape runtime padding propagation when cropped axis is dropped#35616
e-ddykim merged 1 commit intoopenvinotoolkit:masterfrom
andrew-k-park:fix_aliased_crop_reshape_outputs

Conversation

@andrew-k-park
Copy link
Copy Markdown
Contributor

Description of the issue(symptom, root-cause, how it was resolved)

  • Symptom: GPU produced wrong box coordinates / accuracy mismatch vs CPU on a detection model with a VariadicSplit (last axis, lengths [1,1,1,1]) followed by base-mode Reshapes that drop the cropped size-1 axis ([N,M,1] -> [N,M]).
  • Root cause: In is_runtime_propagatable_padding() (last-axis crop branch), the trailing-dim matching loop exits immediately when the cropped axis is size 1, returning true even when the reshape removes that axis. With no output dim left to carry the crop's dynamic padding, the four sibling reshape outputs propagated zero padding and ended up aliased to the same base-buffer offset, so downstream consumers read interleaved channel data as if it were contiguous.
  • Fix: Track the number of trailing output dims actually matched against the cropped axis (matched_trailing_dims) and reject propagation when none were matched and the reshape reduces rank — i.e. the cropped axis is genuinely dropped. Identity reshapes that preserve it ([N,M,1] -> [N,M,1]) remain eligible.

The code and line that caused this issue (if it is not changed directly)

  • src/plugins/intel_gpu/src/graph/include/reshape_inst.h

Reproduction step and snapshot (if applicable. Do not attach for customer model)

  • ./ov_gpu_unit_tests --gtest_filter='prepare_buffer_fusing.in_place_crop_dynamic_last_axis_split_to_collapsing_reshape'

Problematic graph

image

Checklist

  • Is it a proper fix? (not a workaround)
  • Did you include test case for this fix, if necessary?
  • Did you review existing test that can be extended to cover this scenario? Which test did you review?
    • Reviewed existing tests under prepare_buffer_fusing in src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp (in-place crop / reshape padding tests)

Tickets:

@andrew-k-park andrew-k-park requested review from a team as code owners April 30, 2026 08:10
@github-actions github-actions Bot added the category: GPU OpenVINO GPU plugin label Apr 30, 2026
@andrew-k-park andrew-k-park added this to the 2026.2 milestone Apr 30, 2026
@andrew-k-park andrew-k-park force-pushed the fix_aliased_crop_reshape_outputs branch 2 times, most recently from 11c3d64 to 90b1bf9 Compare May 3, 2026 12:39
Co-authored-by: Copilot <copilot@github.com>
@andrew-k-park
Copy link
Copy Markdown
Contributor Author

no performance regression on daily (LLM) test

@e-ddykim e-ddykim added this pull request to the merge queue May 4, 2026
Merged via the queue into openvinotoolkit:master with commit 540f6b2 May 4, 2026
186 of 188 checks passed
@andrew-k-park andrew-k-park deleted the fix_aliased_crop_reshape_outputs branch May 4, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: GPU OpenVINO GPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants