Skip to content

Conversation

@snnn
Copy link
Member

@snnn snnn commented Aug 3, 2025

Description

Move moving weights to memory to the end of Graph::Resolve().
Modify Inject so it copies data into TensorProto according to the C API
docs.

Motivation and Context

TypeAndShape inference runs as a part of Resolve() and it unable to
inspect and load the initializers that point to OrtValues at that time.
We choose to move TensorProto to OrtValue conversion at the end of
Resolve().

References: #25579

### Description
<!-- Describe your changes. -->
Move moving weights to memory to the end of Graph::Resolve().
Modify Inject so it copies data into TensorProto according to the C API
docs.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
TypeAndShape inference runs as a part of `Resolve()` and it unable to
inspect and load the initializers that point to OrtValues at that time.
We choose to move TensorProto to OrtValue conversion at the end of
`Resolve()`.

References: #25579
@snnn snnn changed the title Move moving weights to memory to the end of Graph::Resolve() (#25626) Cherry-pick PR #25626 to 1.23.0 release branch Aug 3, 2025
@fs-eire
Copy link
Contributor

fs-eire commented Aug 3, 2025

Not sure if this failure on MacOS CI (webgpu/x64) is related or not: https://github.com/microsoft/onnxruntime/actions/runs/16700824576/job/47271521600

2: libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
 2/10 Test  #2: onnxruntime_test_all ....................Subprocess aborted***Exception: 212.93 sec

@snnn
Copy link
Member Author

snnn commented Aug 3, 2025

Oh .... Definitely it's a bug. Destruction order problem.

@yuslepukhin
Copy link
Member

Oh .... Definitely it's a bug. Destruction order problem.

Which mac is being used for the CI. Is it Intel or M1?

@yuslepukhin
Copy link
Member

I am approving it. I will be debugging Mac today.

@adrianlizarraga adrianlizarraga merged commit c4a46af into rel-1.23.0 Aug 4, 2025
91 of 92 checks passed
@adrianlizarraga adrianlizarraga deleted the snnn/p5968 branch August 4, 2025 20:19
@snnn snnn mentioned this pull request Sep 16, 2025
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.

5 participants