Skip to content

[ONNX] Enhance tensor handling for external data and add tests for ex…#34973

Merged
sgbihu merged 4 commits intoopenvinotoolkit:masterfrom
sgbihu:fix_webnn_scalar2scalar_ort_empty_weight
Apr 4, 2026
Merged

[ONNX] Enhance tensor handling for external data and add tests for ex…#34973
sgbihu merged 4 commits intoopenvinotoolkit:masterfrom
sgbihu:fix_webnn_scalar2scalar_ort_empty_weight

Conversation

@sgbihu
Copy link
Copy Markdown
Contributor

@sgbihu sgbihu commented Mar 27, 2026

Details:

Tickets:

AI Assistance:

  • *AI assistance used: no
  • If yes, summarize how AI was used and what human validation was performed (build/tests/manual checks).

@sgbihu sgbihu requested a review from a team as a code owner March 27, 2026 02:06
@github-actions github-actions bot added the category: ONNX FE OpenVINO ONNX FrontEnd label Mar 27, 2026
@sgbihu sgbihu force-pushed the fix_webnn_scalar2scalar_ort_empty_weight branch from 29941f6 to f5260f0 Compare March 27, 2026 10:04
@mvafin mvafin requested a review from Copilot March 30, 2026 13:37
Copy link
Copy Markdown
Contributor

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 PR updates the ONNX frontend’s initializer/tensor handling for external data (including ORT-managed memory cases) and adds a regression test to cover the “0-size external weight / empty shape” scenario referenced by CVS-183409.

Changes:

  • Treat TensorONNXPlace instances with data_location as externally backed when computing element counts.
  • In ORT “self-managed data” (*/_ORT_MEM_ADDR_/*) case, propagate an external location string so the tensor is handled via the external-data path.
  • Add a new Expand scalar regression test and corresponding model.

Reviewed changes

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

Show a summary per file
File Description
src/frontends/onnx/tests/onnx_import.in.cpp Adds a new regression test for Expand scalar with ORT-managed empty external shape tensor.
src/frontends/onnx/tests/models/expand_scalar_failsafe_node_ort_mem.prototxt Adds a model with an external initializer using the ORT memory marker and zero length.
src/frontends/onnx/frontend/src/core/tensor.hpp Adjusts element-count computation for TensorONNXPlace when data_location is present.
src/frontends/onnx/frontend/src/core/tensor.cpp Refactors external buffer handling and adds size/shape consistency validation for constants.
src/frontends/onnx/frontend/src/core/graph_iterator_proto.cpp Ensures ORT-managed external data carries an external_location marker.

@sgbihu sgbihu force-pushed the fix_webnn_scalar2scalar_ort_empty_weight branch from df4822a to f99a3b7 Compare April 2, 2026 02:48
@sgbihu sgbihu requested a review from Copilot April 2, 2026 02:56
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@sgbihu
Copy link
Copy Markdown
Contributor Author

sgbihu commented Apr 2, 2026

build_jenkins

@sgbihu sgbihu enabled auto-merge April 3, 2026 02:00
@sgbihu sgbihu added this pull request to the merge queue Apr 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 3, 2026
@sgbihu sgbihu added this pull request to the merge queue Apr 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 3, 2026
@sgbihu sgbihu added this pull request to the merge queue Apr 4, 2026
Merged via the queue into openvinotoolkit:master with commit 134e40c Apr 4, 2026
220 of 222 checks passed
@sgbihu sgbihu deleted the fix_webnn_scalar2scalar_ort_empty_weight branch April 4, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: ONNX FE OpenVINO ONNX FrontEnd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants