openvino icon indicating copy to clipboard operation
openvino copied to clipboard

Fix ReduceMax output shape correctness on CPU and GPU.

Open ShreyasN707 opened this issue 3 weeks ago • 3 comments

Details:

  • Fixed an issue where ReduceMax operations were producing incorrect output shapes (e.g., [1, 960] instead of [1]) on both CPU and GPU plugins.
  • CPU Plugin: Enabled ConvertReduceMaxToPooling transformation in src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp. This forces ReduceMax to be converted to - MaxPool, which correctly handles shape inference and keep_dims, avoiding the issue where the operation was dropped or mishandled.
  • GPU Plugin: Disabled ConvertReduceToReshape transformation in src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp. This prevents the plugin from incorrectly optimizing "redundant" reductions into Reshapes, ensuring the ReduceMax operation is preserved.

Tickets: N/A @ShreyasN707 Can you please update as much as possbile per following template?

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

  • A
  • B

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

  • intel_gpu/src/… (or func name)

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

  • $ benchmark_app …
  • ...

Problematic graph

  • If it is related to graph, please describe the graph
  • If you need to show captured graph, attach on the ticket

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?

Tickets:

  • N/A

ShreyasN707 avatar Dec 03 '25 19:12 ShreyasN707

do not modify .gitignore of the project with your local files, please. to be corrected

mlukasze avatar Dec 04 '25 05:12 mlukasze

do not modify .gitignore of the project with your local files, please. to be corrected

Ohh i byemistakely pushed that too. Will fix it!

ShreyasN707 avatar Dec 04 '25 07:12 ShreyasN707

@isanghao @peterchen-intel please review my PR.

ShreyasN707 avatar Dec 07 '25 17:12 ShreyasN707

@peterchen-intel Please review my PR.

ShreyasN707 avatar Dec 12 '25 17:12 ShreyasN707

@ShreyasN707 Please update the description per template. I don't think this can be accepted by just commenting these 2 lines. It may require more accurate matching to your case to limit the change scope.

peterchen-intel avatar Dec 15 '25 00:12 peterchen-intel