Skip to content

Conversation

@byungilm
Copy link
Contributor

@byungilm byungilm commented Nov 3, 2025

  • Reorder caused unexpected input format for resample_opt kernel's fused ops

Description of the issue

  • A Reorder is added between the Resample and its dep node, 'conv.81', at reorder_inputs.
    Input preferred format of the Resample was simple format while 'conv.81' has blocked format output.
image
  • The reason of simple format selection is that get_shape_infer_dependencies() of Resample returned dependency of input1,2
    However, this resample primitive did not have input1,2 as the shape_infer_dependencies because it is already converted to attribute. Input1 was actually an input from fused operation.
  • Dependency result from get_shape_infer_dependencies() of Resample was invalid.
    If vector values of sizes and scales exists, it means Resample has no dependency for input1 and input2.

The code and line that caused this issue

  • When Resample primitive is created, input1 and 2 may be converted to attribute from this code
    src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp
  • missing logic in resample_opt.cpp to prevent simple format post-ops

Reproduction step and snapshot

  • Reproduced by benchmark
    ./benchmark_app -m inference.xml -d GPU.1 -nireq 1 -niter 1 -data_shape x[1,3,736,608]

Checklist

  • Is it a proper fix?
  • Did you include test case for this fix, if necessary?
  • Did you review existing test that can be extended to cover this scenario? Passed llm_bench

Tickets:

+ Reorder caused unexpected format change

Signed-off-by: Min,Byungil <[email protected]>
Signed-off-by: Min,Byungil <[email protected]>
@byungilm byungilm requested review from a team as code owners November 3, 2025 12:58
@byungilm byungilm added category: GPU OpenVINO GPU plugin do_not_merge labels Nov 3, 2025
Signed-off-by: Min,Byungil <[email protected]>
Signed-off-by: Min,Byungil <[email protected]>
@byungilm byungilm changed the title Fix invalid format for resample opt Fix invalid input format of fused ops for resample opt Nov 5, 2025
+ Not to add Reorder for resample in reorder_inputs
+ Not to add logic into remove_redundant_reorder

Signed-off-by: Min,Byungil <[email protected]>
Signed-off-by: Min,Byungil <[email protected]>
Signed-off-by: Min,Byungil <[email protected]>
@byungilm byungilm requested a review from hyunback November 5, 2025 08:27
@isanghao isanghao changed the title Fix invalid input format of fused ops for resample opt [GPU] Fix invalid input format of fused ops for resample opt Nov 5, 2025
Copy link
Contributor

@hyunback hyunback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@byungilm byungilm requested a review from isanghao November 5, 2025 12:22
Copy link
Contributor

@ahnyoung-paul ahnyoung-paul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Min,Byungil <[email protected]>
std::vector<size_t> get_shape_infer_dependencies() const override { return {1, 2}; }
std::vector<size_t> get_shape_infer_dependencies() const override {
// if vector of sizes or scales exists, resample in CreateInterpolateOp generates no dependency for inputs of sizes and scales
if (typed_desc()->sizes.size() != 0 || typed_desc()->scales.size() != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you add an assertion so that we can prevent mistake in the future?

// Both sizes and scales should be fed as attribute
OPENVINO_ASSERT(typed_desc()->sizes.size() != 0 && typed_desc()->scales.size() != 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied assertion to prevent mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied assertion to the if condition.

+ add assertion to prevent possible mistake

Signed-off-by: Min,Byungil <[email protected]>
@isanghao isanghao enabled auto-merge November 6, 2025 09:32
@isanghao isanghao added this pull request to the merge queue Nov 6, 2025
Merged via the queue into openvinotoolkit:master with commit 94b8f85 Nov 6, 2025
187 checks passed
byungilm added a commit to byungilm/openvino that referenced this pull request Nov 7, 2025
…otoolkit#32654)

+ Reorder caused unexpected input format for resample_opt kernel's fused
ops

### Description of the issue
- A Reorder is added between the Resample and its dep node, 'conv.81',
at reorder_inputs.
Input preferred format of the Resample was simple format while 'conv.81'
has blocked format output.
<img width="1145" height="39" alt="image"
src="https://github.com/user-attachments/assets/5af9325d-0d76-439b-9a24-5650cf088951"
/>

- The reason of simple format selection is that
get_shape_infer_dependencies() of Resample returned dependency of
input1,2
However, this resample primitive did not have input1,2 as the
shape_infer_dependencies because it is already converted to attribute.
Input1 was actually an input from fused operation.
- Dependency result from get_shape_infer_dependencies() of Resample was
invalid.
If vector values of sizes and scales exists, it means Resample has no
dependency for input1 and input2.


#### The code and line that caused this issue
- When Resample primitive is created, input1 and 2 may be converted to
attribute from this code
   src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp
 - missing logic in resample_opt.cpp to prevent simple format post-ops
 
#### Reproduction step and snapshot
 - Reproduced by benchmark
`./benchmark_app -m inference.xml -d GPU.1 -nireq 1 -niter 1 -data_shape
x[1,3,736,608]`

 
#### Checklist
 - [x] Is it a proper fix?
 - [X] Did you include test case for this fix, if necessary? 
- [x] Did you review existing test that can be extended to cover this
scenario? Passed llm_bench
     
### Tickets:
 - CVS-175824

---------

Signed-off-by: Min,Byungil <[email protected]>
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.

5 participants