[GPU] Fix in-place crop optimization for batch-axis split with spatial-flatten reshape#34680
Queued
andrew-k-park wants to merge 1 commit intoopenvinotoolkit:masterfrom
Queued
Conversation
e-ddykim
approved these changes
Mar 13, 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
model.reshape()is called to set a static batch size. SSIM drops from 0.999 to 0.903, with max absolute error ~3.86 across all 12 outputs.crop_axis == 0 && batch == 1to identify batch-squeeze reshapes. This incorrectly matched RAFT's spatial-flatten reshape pattern[1, 256, 65, 120] → [1, 256, 7800]where the batch dim is preserved but spatial dims are merged. The wrongdyn_pad_dimspadding was applied to the crop and its downstream reshape, causing them to read data from incorrect memory offsets.!(reshape_output[0].is_static() && reshape_output[0].get_length() == 1)is applied at all three code paths:is_runtime_propagatable_padding(), build-time dynamic padding mask, and runtime padding offset calculation.The code and line that caused this issue (if it is not changed directly)
Reproduction step and snapshot (if applicable. Do not attach for customer model)
Problematic graph
[1,C,H,W] → [C,H,W]) and applied batch-axis dynamic padding, causing crop nodes to be markedoptimized outwith wrongdyn_pad_dims.VariadicSplit.out1(crop) andReshape_1changed fromnopadtodyn_pad_dims.Checklist
in_place_crop_dynamic_batch_axis_split_with_reshape— this tests the valid batch-squeeze pattern and Added new testTickets: