Skip to content

ORT 1.24.5 Cherry Picks#28100

Merged
adrastogi merged 4 commits intorel-1.24.5from
adrastogi/cherry-pick-editor-compile
Apr 17, 2026
Merged

ORT 1.24.5 Cherry Picks#28100
adrastogi merged 4 commits intorel-1.24.5from
adrastogi/cherry-pick-editor-compile

Conversation

@adrastogi
Copy link
Copy Markdown
Contributor

@adrastogi adrastogi commented Apr 16, 2026

This cherry-picks the following commits for the release:

Also took an isolated change to base_tester.cc from here to avoid a unit test failure.

### Description
This change adds a feature to the Compile API, allowing an in-memory
OrtModel created via the Model Editor API to be compiled directly
without first serializing to a file or buffer.

### 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. -->
The Model Editor API and Compile API are both public C APIs in the ONNX
Runtime, but until now there was no way to pass a programmatically
constructed model directly to compilation. This change attempts to
closes that gap (see #26750) and ensures the new code path behaves
identically to the established file and buffer paths.

---------

Co-authored-by: Aditya Rastogi <adityar@ntdev.microsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@adrastogi adrastogi requested review from guschmue and tianleiwu April 16, 2026 19:49
adrastogi and others added 2 commits April 16, 2026 16:33
<!-- Describe your changes. -->
This change tries to address a problem in the DML EP where AlignToPow2
rounded up tensorByteSize to a 4-byte boundary before the data was read
from the source buffer. This caused CreateCpuResource, CreateResource,
WriteToFile, and the inputRawData vector construction to read 1–3 bytes
past the end of the original tensor data.

CreateResource and CreateCpuResource already independently align the
D3D12 resource descriptor size, so they work correctly with the original
(unaligned) byte count. The fix is to move the alignment to the location
where it's needed.

<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
This is required because it addresses a crash / incorrect behavior in
the DML EP.
### Description
<!-- Describe your changes. -->
DmlOperatorQuantization21 was missing the tensor reshaping logic that
the older DmlOperatorElementwiseQLinear already had.

Scalar scale tensors get padded to 4D, but a 5D input stays 5D. DML
rejects the dimension mismatch with E_INVALIDARG, and the resulting
exception unwind triggers a sized-delete bug in WRL's MakeAllocator
which address sanitizer detects. The fix is to port the same logic from
the DmlOperatorElementwiseQLinear into this path, so that the dimensions
match.

### 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. -->
This is required to ensure the DML EP correctly handles this scenario.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@adrastogi adrastogi changed the title [1.24.5 Cherry Pick] Add OrtModel input support for Compile API (#27332) ORT 1.24.5 Cherry Picks Apr 16, 2026
@adrastogi adrastogi force-pushed the adrastogi/cherry-pick-editor-compile branch from 9984c33 to 0730bc5 Compare April 17, 2026 00:05
Copy link
Copy Markdown
Contributor

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍

@adrastogi
Copy link
Copy Markdown
Contributor Author

DML tests are the same failures seen when setting up the branch (i.e. unrelated to this payload).

2026-04-17T01:52:01.1938650Z 2: [ FAILED ] MeanVarianceNormalizationTest.DefaultAxes
2026-04-17T01:52:01.1939207Z 2: [ FAILED ] MeanVarianceNormalizationTest.AllAxes
2026-04-17T01:52:01.1939947Z 2: [ FAILED ] MVNContribOpTest.MeanVarianceNormalizationCPUTest_Version1_TO_8

(Logs from ingesting the version change prior to the cherry-pick payload are here)

@adrastogi adrastogi merged commit ef605cd into rel-1.24.5 Apr 17, 2026
89 of 100 checks passed
@adrastogi adrastogi deleted the adrastogi/cherry-pick-editor-compile branch April 17, 2026 06:31
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.

3 participants