Skip to content

Support ONNX opset 28 APIs and complete dtype exports - #3138

Merged
Justin Chu (justinchuby) merged 5 commits into
mainfrom
justinchuby-latest-onnx-support
Nov 4, 2026
Merged

Justin Chu (justinchuby) merged 5 commits into
mainfrom
justinchuby-latest-onnx-support

Conversation

@justinchuby

@justinchuby Justin Chu (justinchuby) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Generate the opset 28 API and expose standard opsets 24–28 at the package root. Keep unreleased opset 29 excluded.
  • Refresh opset 25 to include Attention's sliding-window attributes.
  • Add FLOAT6E2M3/FLOAT6E3M2 annotations and export all existing low-bit dtype annotations.
  • Require onnx_ir 1.1.0, which introduced float6 support and transitively requires ml_dtypes 0.5.0 or later; align the CI ONNX IR pin.
  • Preserve ONNX 1.17 compatibility by filtering schema type strings against installed ONNX enums and resolving annotation names through IR.
  • Document the supported APIs, dtype requirements, and API generation command excluding opset 29.

Stack

Registered as a native GitHub stack in this order:

  1. This PR: APIs, dtypes, documentation, and dependencies; targets main.
  2. #3139: version-converter implementation, documentation, and regression coverage; targets this PR's branch.

This PR's diff contains no version-converter changes. The combined stack preserves the complete implementation from before the split.

CI follow-up

  • Split SwiGLU coverage from the SpaceToDepth mode-attribute check. The pinned ONNX weekly build reports opset 28 but predates that attribute, so its availability is now checked against the actual installed schema. SwiGLU coverage still runs.
  • Classify backend roundtrips with Optional graph inputs/outputs as unsupported by the scripting frontend, matching its existing annotation limitations. This does not add Optional-I/O frontend support or disable tests based on the presence of Optional operators alone.
  • The Phi export schema-revision regression is fixed in the converter layer, Complete native ONNX opset conversion through 28 #3139. Inspected failed stable/nightly job logs contain no native ORT crash signatures; no ORT patch is justified by that evidence.

Validation

  • Exact pinned CI ONNX weekly 1.23.0.dev20260831: complete backend roundtrip, API, and dtype suites 1104 passed, 760 skipped, no failures, with only the blanket Windows backend skip removed to exercise Linux-like coverage. Existing unsupported frontend/runtime cases remain skipped; the unavailable SpaceToDepth mode check skips independently.
  • Current ONNX 1.24 API suite: 7 passed, including the SpaceToDepth mode check.
  • Earlier independent bottom-layer integration across scripting/builders, IR schemas, tensors, API/dtype exports, and the unchanged converter suite: 295 passed, 1 skipped, 7 existing xfails.
  • Every concrete IR dtype has a public annotation; numeric storage roundtrips include float6 and other low-bit types. API/dtype compatibility was also covered by earlier integration runs on current ONNX and minimum ONNX 1.17.
  • lintrunner -a and git diff --check pass. Local ORT 1.31.1 is newer than the CI runtime pins; fresh hosted CI remains authoritative for those versions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread onnxscript/onnx_opset_test.py Resolved
Comment thread onnxscript/onnx_types_test.py Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.99563% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.25%. Comparing base (682b59d) to head (1eb1149).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnxscript/onnx_opset/_impl/opset28.py 51.69% 57 Missing ⚠️
onnxscript/onnx_opset_test.py 81.66% 10 Missing and 1 partial ⚠️
onnxscript/onnx_opset/_impl/opset25.py 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3138      +/-   ##
==========================================
- Coverage   73.28%   73.25%   -0.04%     
==========================================
  Files         267      269       +2     
  Lines       33214    33441     +227     
  Branches     3183     3192       +9     
==========================================
+ Hits        24342    24498     +156     
- Misses       7802     7874      +72     
+ Partials     1070     1069       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@justinchuby Justin Chu (justinchuby) changed the title Support ONNX opset 28, float6 dtypes, and version conversion Support ONNX opset 28 APIs and complete dtype exports Oct 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The SpaceToDepth wrapper unconditionally forwards mode, causing even default DCR calls to fail with KeyError: 'mode' against the pinned ONNX schema, which lacks that attribute.

1 open issue
What changed in this PR

Extends ONNXScript’s public APIs through opset 28 and completes low-bit dtype exports. This provides the API and dependency foundation for the separate version-converter changes in #3139.

Changes:

  • Adds generated opset 28 APIs, exports opsets 24–28, and refreshes Attention’s sliding-window attributes.
  • Adds float6 annotations, completes dtype exports, and updates ONNX IR requirements while preserving ONNX 1.17 compatibility.
  • Expands API and dtype tests, adjusts backend coverage for unsupported Optional I/O, and documents availability and generation.
File Description
pyproject.toml Raises the ONNX IR minimum for float6 support.
opgen/​README.md Documents generation excluding opset 29.
onnxscript/​onnx_types.py Adds float6 annotations and resolves dtype names through IR.
onnxscript/​onnx_types_test.py Tests dtype exports, annotations, and storage roundtrips.
onnxscript/​onnx_opset/​_impl/​opset28.py Adds generated opset 28 operator wrappers.
onnxscript/​onnx_opset/​_impl/​opset25.py Adds Attention sliding-window parameters and refreshes generated documentation.
onnxscript/​onnx_opset/​__init__.py Registers and exports opset 28.
onnxscript/​onnx_opset_test.py Tests public opsets, schema signatures, and new APIs.
onnxscript/​backend/​onnx_export_test.py Skips scripting roundtrips with Optional graph I/O.
onnxscript/​_internal/​type_annotation.py Filters schema dtype strings against installed ONNX enums.
onnxscript/​__init__.py Exports recent opsets and remaining low-bit annotations.
noxfile.py Aligns the CI ONNX IR pin with the new minimum.
docs/​api/​opsets.md Documents public opsets, dtype exports, and requirements.

Review effort: Balanced

Comment thread onnxscript/onnx_opset/_impl/opset28.py Resolved
@justinchuby
Justin Chu (justinchuby) enabled stacked auto-merge (squash) November 4, 2026 03:33
@github-project-automation github-project-automation Bot moved this from Todo to Done in ONNX Script Review Board Nov 4, 2026
@justinchuby
Justin Chu (justinchuby) merged commit 9112df0 into main Nov 4, 2026
31 of 34 checks passed
@justinchuby
Justin Chu (justinchuby) deleted the justinchuby-latest-onnx-support branch November 4, 2026 03:37
Justin Chu (justinchuby) added a commit that referenced this pull request Nov 4, 2026
Restore the version-converter slice as the upper layer above #3138, preserving the original combined tree.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Justin Chu (justinchuby) added a commit that referenced this pull request Nov 4, 2026
Restore the version-converter slice as the upper layer above #3138, preserving the original combined tree.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants