Skip to content

Cherry-pick PR #25626 to 1.23.0 release branch - #25640

Merged
adrianlizarraga merged 1 commit into
rel-1.23.0from
snnn/p5968
Aug 4, 2025
Merged

Cherry-pick PR #25626 to 1.23.0 release branch#25640
adrianlizarraga merged 1 commit into
rel-1.23.0from
snnn/p5968

Conversation

@snnn

@snnn snnn commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

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

fs-eire commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

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

snnn commented Aug 3, 2025

Copy link
Copy Markdown
Contributor Author

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

@yuslepukhin

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

4 participants