Repository navigation
Complete opset 28 Optional runtime type integration - #32393
Justin Chu (justinchuby) merged 12 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Register complex and FP6 tensor, sequence, and optional runtime types across IR14 kernel constraints and the shared-provider bridge. Add focused type-info and CPU Optional opset-28 coverage while preserving pre-28 boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f49bc-2c29-4f73-9bcb-789e6b0e67d5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f49bc-2c29-4f73-9bcb-789e6b0e67d5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f49bc-2c29-4f73-9bcb-789e6b0e67d5
Avoid passing template commas directly through GTest assertion macros so the focused type-info coverage compiles on MSVC. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f49bc-2c29-4f73-9bcb-789e6b0e67d5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b3f49bc-2c29-4f73-9bcb-789e6b0e67d5
|
Why do we need complex? They are never used. |
|
Good point. Removing |
Keep opset 28 Optional focused on FP6 and other registered IR14 types while removing complex registrations and provider bridge ABI additions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve opset 28 Optional registrations alongside new Cast, QDQ, and BitShift kernels. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
### Description <!-- Describe your changes. --> Reintegrate the ONNX 1.23 base plumbing originally introduced by #32359 and reverted by #33073, now using ONNX **1.23.2**. - Coordinate source/submodule, FetchContent, vcpkg, and Python dependency pins and raise the relevant opset ceilings to 28. - Restore Float6 public element-type mappings and conversion coverage, preserving subsequent independent type-support changes. - Update existing-type Cast registrations, CPU/CUDA Mod boundaries, signed BitShift support, provider compatibility, backend filters/tolerances, and operator documentation. - Materialize the removed upstream node-test corpus with exact-version and minimum-case guards, and cover backend serialization and released-opset policy. - Keep matching FetchContent/vcpkg compatibility patches; remove the released-opset correction now fixed upstream in 1.23.2. - Address review feedback: OpenVINO rejects BitShift-28; CPU/CUDA legacy SpaceToDepth kernels stop at 27; DirectML accepts only safe DCR; unverified graph providers defer SpaceToDepth-28. Full builds use ONNX function expansion for CRD, with literal-output and routing regressions. Avoid creating unsupported SpaceToDepth-28 nodes in the post-expansion Slice/Concat fusion. - Use shared ABI-safe tensor-element conversion in the native ONNX node runner, fixing INT2/UINT2/FLOAT8E8M0 corpus decoding after the main merge. ### 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 a redo of #32359 after its rollback in #33073. ONNX 1.23.2 includes the external tensor read/re-save fix from onnx/onnx#8472 for onnx/onnx#8471 and the released-opset metadata fix from onnx/onnx#8544 for onnx/onnx#8529. The redundant local `LastReleaseVersionMap` patch has been removed. Remaining FetchContent/vcpkg patches are byte-identical and apply against the pinned release. **Scope:** This PR establishes dependency/runtime base integration. Full per-operator opset-28 support remains separate follow-up work; see #32362, #32369, #32372, #32378, #32381, and #32393. These references describe staged scope, not a claim that every follow-up has landed or every opset-28 operator is supported. Runtime function expansion is a full-build fallback, not minimal/ORT-format runtime coverage. ### Local validation Completed on Windows with retained CPU-only Ninja/MSVC `RelWithDebInfo` builds and strict released-opset policy: - Built `onnxruntime_provider_test`, `onnxruntime_test_all`, `onnx_test_runner`, and Python bindings against ONNX 1.23.2; retained build remains available for incremental work. - Source-built and installed the exact patched ONNX 1.23.2 Python wheel. - Separate `--minimal_build extended` shared runtime configured, compiled, and linked successfully with ML/contrib ops and unit tests disabled. This exercises `ONNX_MINIMAL_BUILD=ON`; it is not a minimal-runtime function-op execution test. - Mod/BitShift/SpaceToDepth/Cast provider tests: **247 passed**, no skips. SpaceToDepth checks default DCR, explicit DCR, and CRD with distinct literal expected outputs, expansion, and legacy opset boundaries. - Slice/Concat fusion and type-info/tensor-proto framework tests: **27 passed**, no skips. - Python backend tests: **22 passed**, plus **2 subtests passed**. - Full Python backend series: **4,066 tests**, **2,685 skipped**, zero failures. Skipped/unsupported coverage is not a pass. - Materialized **1,884 node cases**. Native CPU runner with `-m 1500` collected **1,760 cases**: **1,590 succeeded**, **170 not implemented**, **zero failed**, exit 0. These results do not establish complete opset-28 support. - Generated CPU operator documentation matches the rebuilt kernel registry; verified archive hashes, patch identity/application, submodule SHA, and changed-file lint. **Remaining validation/infrastructure limits:** GPU and other EP execution relies on CI; optional-provider routing checks are compiled into the relevant builds but were unavailable locally. Full unfiltered C++ suites and the ancillary broad `ALL` target were not rerun. The oracle-dependent corpus equivalence test skips because upstream no longer ships the corpus. The new ONNX 1.23.2 tarball currently returns **404 from the Microsoft vcpkg asset mirror**; it still needs Terrapin/infra seeding before read-only `x-block-origin` vcpkg legs can download it. FetchContent and the successful minimal build are mirror-independent. New-head CI is pending. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
Preserve Optional opset 28 kernels and tests alongside the updated ONNX 1.23 base. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
…ustinchuby-complete-optional-opset-28 # Conflicts: # onnxruntime/test/framework/type_info_test.cc Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
Merged |
…ustinchuby-complete-optional-opset-28 Co-authored-by: gramalingam <10075881+gramalingam@users.noreply.github.com>
Merged the latest |
There was a problem hiding this comment.
🟡 Changes recommended
Complex runtime types remain unregistered, and Float4 tensor sequences fail type inspection.
2 open findings
What changed in this PR
Extends CPU Optional operators for opset 28 and introduces IR14 runtime type plumbing.
Changes:
- Adds IR14 tensor, sequence, and optional type collections.
- Splits CPU Optional kernel registrations at opset 28.
- Extends provider bridge APIs and adds focused tests.
| File | Description |
|---|---|
onnxruntime/test/providers/cpu/optional/optional_ops_test.cc |
Adds opset-28 FP6 Optional tests. |
onnxruntime/test/framework/type_info_test.cc |
Tests IR14 type registration and C API mappings. |
onnxruntime/core/session/provider_bridge_ort.cc |
Implements IR14 provider-host methods. |
onnxruntime/core/providers/shared_library/provider_wrappedtypes.h |
Exposes IR14 type lists to shared providers. |
onnxruntime/core/providers/shared_library/provider_interfaces.h |
Appends IR14 provider-host ABI methods. |
onnxruntime/core/providers/cpu/optional/optional_ops.cc |
Adds opset-28 Optional kernel constraints. |
onnxruntime/core/providers/cpu/cpu_execution_provider.cc |
Registers new Optional kernel versions. |
onnxruntime/core/framework/tensor_type_and_shape.cc |
Maps complex types to C API enums. |
onnxruntime/core/framework/data_types.cc |
Registers aggregate runtime types. |
include/onnxruntime/core/framework/data_types.h |
Declares IR14 type-list APIs. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


Description
Stacked on #32372.
Motivation and Context
ONNX opset 28 expands Optional schemas to the IR14 tensor and sequence type sets. ORT needs matching runtime registration, TypeProto/public C API mappings, kernel constraints, and shared-provider access so valid complex and FP6 Optional values resolve consistently.
Local validation:
lintrunnerpassed for all 13 files in this stacked diffonnxruntime_frameworkrebuilt successfully after the additive FP6 base repair;tensorprotoutils.ccrecompiled and C2912 is gonedata_types.cc,tensor_type_and_shape.cc,cpu_execution_provider.cc,optional_ops.cc, andprovider_bridge_ort.ccoptional_ops_test.cc,type_info_test.cc, and the repaired FP6cast_op_test.cconnxruntime_provider_testandonnxruntime_test_allfail to link on 62 inherited opset-25/28 symbols (including Q/DQ/Cast kernel registrations, ONNX DepthToSpace/SpaceToDepth doc symbols, and Float4 aggregate types); no Optional symbol is among the unresolved references