Skip to content

Integration with ONNX rel-1.18.0#24449

Merged
titaiwangms merged 22 commits intomainfrom
titaiwang/update_onnx_118rc
Apr 29, 2025
Merged

Integration with ONNX rel-1.18.0#24449
titaiwangms merged 22 commits intomainfrom
titaiwang/update_onnx_118rc

Conversation

@titaiwangms
Copy link
Contributor

@titaiwangms titaiwangms commented Apr 16, 2025

Description

The PR adds CPU support by following release logics in https://github.com/onnx/onnx/wiki/Logistics-for-ONNX-Release-1.18.0. The goal is to do the minimal changes needed to ensure ONNXRUNTIME works fine with ONNX 1.18.0

Motivation and Context

Essentially, incoming ONNX 1.18.0 provides the following
(1) Introduce opset 23 (included in this PR)
(2) Support Attention, RMSNormalization, and RotaryEmbedding (NOT included in this PR)
(3) Support float4e2m1 (NOT included in this PR)

Remaining Issues

  1. onnx.patch
  1. Support float4e2m1 (Support FLOAT4E2M1 #24553)
  2. Support Attention([Feature Request] Implement Attention-23 #24554), RMSNormalization([Feature Request] Implement RMSNormalization-23 #24555), and RotaryEmbedding([Feature Request] Implement RotaryEmbedding-23 #24556)
  3. Disable QNN tests

@titaiwangms titaiwangms changed the title Integration with ONNX 1.18 Integration with ONNX 1.18.0 Apr 16, 2025
@jywu-msft
Copy link
Member

This is not targeted for OnnxRuntime 1.22 release, right?

@titaiwangms
Copy link
Contributor Author

This is not targeted for OnnxRuntime 1.22 release, right?

No, it's not. ONNX 1.18.0 still on rc.

@titaiwangms titaiwangms changed the title Integration with ONNX 1.18.0 Integration with ONNX rel-1.18.0 Apr 25, 2025
Copy link
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 integrates ONNX Runtime with ONNX rel‑1.18.0 by adding minimal changes required for CPU support and updating opset registrations consistent with the new release. Key changes include:

  • Updating CPU control flow kernels (Scan, Loop, If) to support opset 23 for float4e2m1.
  • Adjusting max supported opset values in core components and registering new opset entries in the operator tables.
  • Refreshing documentation and dependency pointers to reflect the latest ONNX commit.

Reviewed Changes

Copilot reviewed 33 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
onnxruntime/core/providers/cpu/controlflow/scan_9.cc Updated kernel registration macro and added opset 23 kernel entry with a TODO for float4e2m1 support.
onnxruntime/core/providers/cpu/controlflow/loop.cc & if.cc Similar updates in control flow kernels to support opset 23.
onnxruntime/core/providers/coreml/builders/impl/base_op_builder.h Increased max supported opset from 21 to 23.
onnxruntime/core/optimizer/transpose_optimization/optimizer_api.h Updated kMaxSupportedOpset from 22 to 23.
onnxruntime/core/optimizer/qdq_transformer/qdq_util.cc Extended Q/DQ node version support to include opset 23.
onnxruntime/core/optimizer/layout_transformation/layout_transformation_potentially_added_ops.h Added opset 23 entries for several operators.
graph.cc Added an include for onnx/defs/parser.h as required by updated ONNX.
js/web/script/generate-webgl-operator-md.ts & js/web/docs/webgl-operators.md Updated generated documentation references for operator definitions.
docs/OperatorKernels.md Revised version ranges for several operators to include opset 23.
docs/How_To_Update_ONNX_Dev_Notes.md Updated instructions to encourage using commit IDs for ONNX submodule updates.
cmake/deps.txt Changed the ONNX dependency URL and commit hash to match the updated version.
Files not reviewed (7)
  • cmake/external/onnx: Language not supported
  • cmake/patches/onnx/onnx.patch: Language not supported
  • cmake/vcpkg-ports/onnx/binskim.patch: Language not supported
  • cmake/vcpkg-ports/onnx/fix-cmakelists.patch: Language not supported
  • cmake/vcpkg-ports/onnx/fix-dependency-protobuf.patch: Language not supported
  • cmake/vcpkg-ports/onnx/portfile.cmake: Language not supported
  • cmake/vcpkg-ports/onnx/vcpkg.json: Language not supported
Comments suppressed due to low confidence (2)

onnxruntime/core/providers/cpu/controlflow/scan_9.cc:547

  • Consider adding test coverage or tracking an issue for implementing float4e2m1 support in the opset 23 kernel registration to ensure the feature is validated once implemented.
// TODO(titaiwang): Add support for float4e2m1.

js/web/script/generate-webgl-operator-md.ts:82

  • [nitpick] The updated script reference improves clarity by explicitly naming the generator; ensure similar explicit naming is used consistently in other documentation references.
def files via [generate-webgl-operator-md.ts](../script/generate-webgl-operator-md.ts).

xadupre
xadupre previously approved these changes Apr 28, 2025
@xadupre
Copy link
Member

xadupre commented Apr 28, 2025

We should really simplify the patches. I assume everyone willing to link with ONNX should go through the sames patches. Looking at the list, it is long and hard to maintain.

@titaiwangms titaiwangms requested a review from justinchuby April 28, 2025 16:51
@titaiwangms titaiwangms merged commit 75101d6 into main Apr 29, 2025
80 of 88 checks passed
@titaiwangms titaiwangms deleted the titaiwang/update_onnx_118rc branch April 29, 2025 21:53
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request May 12, 2025
### Description
<!-- Describe your changes. -->

The PR adds CPU support by following release logics in
https://github.com/onnx/onnx/wiki/Logistics-for-ONNX-Release-1.18.0. The
goal is to do the minimal changes needed to ensure ONNXRUNTIME works
fine with ONNX 1.18.0

### 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. -->

Essentially, incoming ONNX 1.18.0 provides the following
(1) Introduce opset 23 (included in this PR)
(2) Support Attention, RMSNormalization, and RotaryEmbedding (**NOT**
included in this PR)
(3) Support float4e2m1 (**NOT** included in this PR)

### Remaining Issues

1. onnx.patch
* ONNXRUNTIME is using static functions (shape inference) from ONNX
(microsoft#24558)
* GroupNormalization-18 is deprecated because its spec was wrong
(microsoft#24560)
* Contrib op registration api from ONNX: OpSchemaRegisterOnce is changed
to explicit, and ONNXRUNTIME was leveraging it to do fluent-chaining
style. (microsoft#24561)
2. Support float4e2m1
(microsoft#24553)
3. Support
Attention(microsoft#24554),
RMSNormalization(microsoft#24555),
and
RotaryEmbedding(microsoft#24556)
4. Disable QNN tests
titaiwangms added a commit that referenced this pull request Jun 10, 2025
Follow up #24449 
This PR integrates with ONNX 1.18.0.
javier-intel pushed a commit to intel/onnxruntime that referenced this pull request Jun 15, 2025
Follow up microsoft#24449 
This PR integrates with ONNX 1.18.0.
quic-ankus pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Nov 25, 2025
Follow up microsoft#24449 
This PR integrates with ONNX 1.18.0.
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