Skip to content

Fix the accuracy issue from onnxruntime single layer test case #31283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgbihu
Copy link
Contributor

@sgbihu sgbihu commented Jul 11, 2025

Details:

  • Align the parameter with ONNX operators
  • Enable 3D tensor resize on 3 dims
  • Avoid reorder when the lowest dimension doesn't scale.

Tickets:

@sgbihu sgbihu requested review from a team as code owners July 11, 2025 07:42
@github-actions github-actions bot added category: CPU OpenVINO CPU plugin category: ONNX FE OpenVINO ONNX FrontEnd labels Jul 11, 2025
@sgbihu sgbihu added ONNX Related to support for ONNX standard. and removed category: CPU OpenVINO CPU plugin category: ONNX FE OpenVINO ONNX FrontEnd labels Jul 11, 2025
@sgbihu sgbihu requested review from Copilot and aobolensk and removed request for a team July 11, 2025 07:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes accuracy issues in the ONNX runtime single layer test case by aligning parameters with ONNX operators, enabling 3D tensor resize operations on 3 dimensions, and optimizing performance by avoiding unnecessary reordering when the lowest dimension doesn't scale.

Key changes include:

  • Updated spatial dimension calculation to dynamically determine dimensions based on input/output tensor differences
  • Added support for ONNX resize operator's antialias and axes attributes
  • Implemented logic to avoid reordering when the lowest dimension remains unchanged

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/plugins/intel_cpu/src/nodes/interpolate.h Updates function signature to accept source and destination dimensions
src/plugins/intel_cpu/src/nodes/interpolate.cpp Implements dynamic spatial dimension calculation and reorder optimization logic
src/frontends/onnx/frontend/src/op/resize.cpp Adds support for antialias and axes attributes in ONNX resize operator
Comments suppressed due to low confidence (2)

src/plugins/intel_cpu/src/nodes/interpolate.cpp:2549

  • [nitpick] The magic number 3 should be replaced with a named constant or derived from srcDims.size() to make the code more maintainable and self-documenting.
        auto* selectedPD = getSelectedPrimitiveDescriptor();

src/plugins/intel_cpu/src/nodes/interpolate.cpp:2041

  • [nitpick] The lambda function name 'avoidReorder' is ambiguous. Consider renaming it to 'shouldAvoidReorder' or 'canAvoidReorder' to better indicate it returns a boolean condition.
                auto avoidReorder = [](const auto& inputDataShape, const auto& outputShape) {

Copy link
Member

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

@sgbihu, please provide tests

@rkazants rkazants added category: CPU OpenVINO CPU plugin category: ONNX FE OpenVINO ONNX FrontEnd labels Jul 11, 2025
@rkazants rkazants requested a review from maxnick July 11, 2025 09:34
@maxnick
Copy link
Contributor

maxnick commented Jul 11, 2025

@chenhu-wang , could you please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin category: ONNX FE OpenVINO ONNX FrontEnd ONNX Related to support for ONNX standard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants