Skip to content

[Experimental] Update ONNX extras - #40821

Merged
jrmccluskey merged 7 commits into
apache:masterfrom
jrmccluskey:onnxBump
Oct 29, 2026
Merged

jrmccluskey merged 7 commits into
apache:masterfrom
jrmccluskey:onnxBump

Conversation

@jrmccluskey

Copy link
Copy Markdown
Contributor

Modernize the ONNX extras group and re-enable testing, which has been disabled since 2024. Prior to updating, the onnx extras group was not able to install on any currently supported Python version.

@github-actions github-actions Bot added python size/m M: 50-249 lines changed labels Oct 26, 2026

@github-actions github-actions Bot 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.

📋 Review Summary

This PR updates the onnx extra and ml_base_core dependency bounds in setup.py, re-enables the ONNX postcommit test tasks in tox.ini and build.gradle (testing lower-bound 119 and latest), and disables multi-process model sharing on OnnxModelHandlerNumPy since onnxruntime.InferenceSession manages its own native thread pools and cannot be safely proxied across processes.

🔍 General Feedback

  • The changes to OnnxModelHandlerNumPy and the updated dependency/tox configurations are well-structured and clearly documented.
  • Note that the branch currently has a merge conflict with recent master changes (from PR #40752) in .github/trigger_files/beam_PostCommit_Python_Dependency.json and adjacent lines in sdks/python/test-suites/tox/py311/build.gradle / sdks/python/tox.ini, so a rebase on master will be needed.
  • One minor cleanup opportunity was noted in tox.ini regarding an obsolete onnx<1.19.0 pin in testenv:py311-ml.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

Comment thread sdks/python/tox.ini
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @tvalentyn for label python.
Backup reviewer: claudevdm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.90%. Comparing base (2213e54) to head (b68dbda).
⚠️ Report is 47 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #40821       +/-   ##
===========================================
+ Coverage        0   79.90%   +79.90%     
===========================================
  Files           0      493      +493     
  Lines           0    83479    +83479     
===========================================
+ Hits            0    66706    +66706     
- Misses          0    16773    +16773     
Flag Coverage Δ
python 79.90% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread sdks/python/setup.py
# Converters for producing ONNX models from scikit-learn,
# TensorFlow and PyTorch models.
'skl2onnx>=1.17.0,<2',
'tf2onnx>=1.17.0,<1.18',

@tvalentyn tvalentyn Oct 28, 2026 •

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.

do you think the upper bounds need to be so tight for this and the below? I'm trusting your judgement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They do, unfortunately. There's some juggling between compatible versions of tensorflow and versions of torch that can exist in the same environment, which is not ideal but does keep the extra here working out-out-the-box.

@Amar3tto

Copy link
Copy Markdown
Collaborator

Should we cherrypick this into release-2.78 branch?

@jrmccluskey

Copy link
Copy Markdown
Contributor Author

@Amar3tto Yeah I can open a cherrypick, this isn't a release blocker necessarily but ONNX was not going to work on 2.78.0 otherwise.

@jrmccluskey
jrmccluskey merged commit 320e100 into apache:master Oct 29, 2026
97 of 99 checks passed
jrmccluskey added a commit that referenced this pull request Oct 29, 2026
* Update ONNX extras

* Trigger postcommits

* Fix py311-ml onnx bounds

* add onnxscript to tox environment

* Add onnxscript to ml_base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants