Skip to content

Fix FLOAT16 tensor attribute serialization in OrtGraphToProto - #33921

Open
Georgij Tsarin (crystarm) wants to merge 1 commit into
microsoft:mainfrom
crystarm:fix/float16-tensor-attributes
Open

Georgij Tsarin (crystarm) wants to merge 1 commit into
microsoft:mainfrom
crystarm:fix/float16-tensor-attributes

Conversation

@crystarm

Copy link
Copy Markdown

Description

  • Add the missing FLOAT16 case to tensor attribute serialization in OrtGraphToProto.
  • Add a ConstantOfShape regression test covering raw_data and int32_data, verifying the serialized payload and inference with optimizations disabled.
  • All 19 EP graph tests pass.

Motivation and Context

Valid FP16 tensor attributes were rejected with Unexpected ONNXTensorElementDataType with value 10.

Fixes #33919.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 12:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the FLOAT16 tensor attribute serialization fix.

No open issues 🎉

What changed in this PR

Fixes FLOAT16 tensor attribute serialization in OrtGraphToProto, addressing the dtype-10 rejection reported in #33919.

Changes:

  • Adds the missing FLOAT16-to-TensorProto type mapping.
  • Adds a ConstantOfShape regression test covering both raw_data and int32_data, checking the serialized type and payload and inference results with optimizations disabled.
File Description
onnxruntime/​test/​ep_graph/​test_ep_graph.cc Adds FLOAT16 attribute serialization and inference regression coverage.
include/​onnxruntime/​core/​providers/​utils/​ort_graph_to_proto.h Handles FLOAT16 tensor attributes in the serialization type switch.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] OrtGraphToProto rejects FLOAT16 tensor attributes (dtype 10), reproducible with ConstantOfShape

2 participants