[GPU] Prevent unsafe in-place crop optimization for 2D-to-1D bbox splits - #37414
Merged
e-ddykim merged 1 commit intoAug 18, 2026
Merged
Conversation
Contributor
|
@zhanmyz The PR LGTM. Please open it for official review and merge. |
Commit 3f24992 introduced runtime padding propagation for the TransposeSplitMatcher QKV pattern. Its axis-1 rank-reducing reshape check also matched object-detection bbox splits: [N, 4] -> [N, 1] -> [N] The resulting in-place crop exposed a padded/strided one-dimensional view to bbox decode arithmetic, producing incorrect box coordinates and NMS results. For example, TF_V2_Faster_RCNN_Inception_ResNet_v2_atrous_coco returned 25 detections instead of the reference 5 detections on GPU. Restrict axis-1 runtime padding propagation to reshape outputs with rank >= 2. This keeps the intended TransposeSplitMatcher path enabled: [-1, 3, H, S] -> [-1, 1, H, S] -> [-1, H, S] while rejecting the unsafe 2D-to-1D bbox-coordinate path. Apply the same rank guard in the VLSDPA-specific check to keep build-time and runtime behavior consistent. Add unit test: prepare_buffer_fusing.in_place_crop_axis1_rank_reducing_to_1d_not_optimized - CVS-192143, CVS-192144, CVS-192235 Signed-off-by: zhanmyz <yazhan.ma@intel.com>
zhanmyz
force-pushed
the
cvs-192143-fix-regression-issue-v1
branch
from
August 17, 2026 07:30
977326f to
7974de9
Compare
zhanmyz
marked this pull request as ready for review
August 17, 2026 07:53
Contributor
Author
Sure, Added unit test to cover the changed code. |
ceciliapeng2011
approved these changes
Aug 17, 2026
Contributor
Author
e-ddykim
approved these changes
Aug 18, 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.
Details:
Description of the issue (symptom, root cause, and resolution)
Symptom:
After commit
3f24992895e41aa669b3743c8b6a7f499f3d789a, several GPU object-detection models produced incorrect detection results. The original reproducer was:TF_V2_Faster_RCNN_Inception_ResNet_v2_atrous_cocotf_detectionsThe same regression pattern was also observed for:
TF_V2_Faster_RCNN_ResNet50_v1_atrous_cocoTF_V2_Mask_RCNN_ResNetv2_atrous_cocoONNX_Runtime_ssd_mobilenet_V1_coco_mlperf_opset10Root Cause
Commit
3f24992895e41aa669b3743c8b6a7f499f3d789aenabled runtime padding propagation for the TransposeSplitMatcher QKV pattern. The new condition inreshape_node::is_runtime_propagatable_padding()accepted any axis-1 crop with a size-1 dimension followed by a rank-reducing reshape:This condition was intended for the QWen-VL pattern:
However, it also accepted the object-detection bbox-coordinate pattern:
The latter is not safe for runtime padding propagation. In the affected models,
Split([N, 4])produces four coordinate crops[N, 1], which are squeezed to one-dimensional vectors[N]and consumed by bbox decode arithmetic. The in-place crop optimization exposed a strided/padded view to downstream kernels that expected a contiguous one-dimensional vector. This corrupted decoded box coordinates and caused NMS to return an incorrect number of detections.The existing unit tests added by commit
3f24992895ecovered the valid QKV/TransposeSplitMatcher path and other padding propagation cases, but did not cover the invalid 2D-to-1D bbox-coordinate boundary case.Resolution:
Restrict the axis-1 rank-reducing padding propagation rule to outputs with rank at least 2:
The same guard is applied in the
vl_sdpapath so both build-time and runtime decisions use the same safety contract.This preserves the intended QWen-VL optimization (
4D -> 3D) while rejecting the unsafe bbox-coordinate case (2D -> 1D). The change is generic and is not tied to a specific model.Performance and compatibility
3f24992895e, so the change restores the previous behavior for these models and avoids an accuracy regression. The valid QWen-VL 4D-to-3D optimization remains enabled.The code and line that caused this issue (if it is not changed directly)
openvino/src/plugins/intel_gpu/src/graph/include/reshape_inst.h
Lines 137 to 141 in 1872889
Reproduction step
Checklist
Tickets: