Skip to content

Update ORT to handle explicit OpSchemaRegisterOnce API in ONNX >= 1.18.0 for fluent chaining #24561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
titaiwangms opened this issue Apr 25, 2025 · 0 comments

Comments

@titaiwangms
Copy link
Contributor

ORT was leveraging on implicit api ONNX_NAMESPACE::OpSchemaRegistry::OpSchemaRegisterOnce https://github.com/microsoft/onnxruntime/blob/fe97f8b608bbd9131a8de25b0d6b57a9ee30c388/onnxruntime/core/graph/contrib_ops/contrib_defs.h#L39C10-L39C64 to do fluent chaining style as following

ONNX_CONTRIB_OPERATOR_SCHEMA(AllReduce)
.SetDomain(kMSDomain)
.SinceVersion(1)
.Input(0, "input", "tensors to be reduced", "T", OpSchema::Variadic)
.Output(0, "output", "reduced tensors", "T", OpSchema::Variadic)
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
"Constrain to float, float16 and double tensors.")
.TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) {
propagateShapeAndTypeFromFirstInput(ctx);
});

However, the api ONNX_NAMESPACE::OpSchemaRegistry::OpSchemaRegisterOnce will be explicit starting from ONNX==1.18.0.

The PR: onnx/onnx#6378
The change: https://github.com/onnx/onnx/blob/9e379bdd51be054c89b29386f17a2fd731ce190f/onnx/defs/schema.h#L984

It's currently avoid from cmake/patches/onnx.patch within #24449

titaiwangms added a commit that referenced this issue Apr 29, 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
(#24558)
* GroupNormalization-18 is deprecated because its spec was wrong
(#24560)
* Contrib op registration api from ONNX: OpSchemaRegisterOnce is changed
to explicit, and ONNXRUNTIME was leveraging it to do fluent-chaining
style. (#24561)
2. Support float4e2m1
(#24553)
3. Support
Attention(#24554),
RMSNormalization(#24555),
and
RotaryEmbedding(#24556)
4. Disable QNN tests
ankitm3k pushed a commit to intel/onnxruntime that referenced this issue 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
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

No branches or pull requests

1 participant