Skip to content

Commit 3fe7e65

Browse files
[5615343,5597780,5371126] Upgrade ORT to 1.24 (#928)
## What does this PR do? **Type of change:** Bug fix **Overview:** Upgrade ORT to 1.24.x to fix various bugs (5615343, 5597780, 5371126). TODO: Verify no regressions by bumping ORT once @ajrasane is back ## Usage See each bug. ## Testing See each bug. ## Before your PR is "*Ready for review*" <!-- If you haven't finished some of the above items you can still open `Draft` PR. --> - **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)** and your commits are signed. - **Is this change backward compatible?**: Yes <!--- If No, explain why. --> - **Did you write any new necessary tests?**: No - **Did you add or update any necessary documentation?**: No - **Did you update [Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?**: Yes <!--- Only for new features, API changes, critical bug fixes or bw breaking changes. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Bug Fixes * Upgraded ONNX Runtime to version 1.24.2, addressing multiple reported issues * Updated system requirements and installation documentation to reflect the new ONNX Runtime version <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com> Signed-off-by: Gwena Cunha <4861122+gcunhase@users.noreply.github.com> Co-authored-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
1 parent 4a11486 commit 3fe7e65

5 files changed

Lines changed: 26 additions & 3 deletions

File tree

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ NVIDIA Model Optimizer Changelog (Linux)
44
0.43 (2026-03-xx)
55
^^^^^^^^^^^^^^^^^
66

7+
**Bug Fixes**
8+
9+
- ONNX Runtime dependency upgraded to 1.24 to solve missing graph outputs when using the TensorRT Execution Provider.
10+
711
**New Features**
812

913
- User does not need to manually register MOE modules to cover experts calibration coverage in PTQ workflow.

docs/source/getting_started/_installation_for_Linux.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Latest Model Optimizer (``nvidia-modelopt``) currently has the following system
2020
+-------------------------+-----------------------------+
2121
| TensorRT-LLM (Optional) | >=1.0 |
2222
+-------------------------+-----------------------------+
23-
| ONNX Runtime (Optional) | 1.22 |
23+
| ONNX Runtime (Optional) | 1.24 |
2424
+-------------------------+-----------------------------+
2525
| TensorRT (Optional) | >=10.0 |
2626
+-------------------------+-----------------------------+

modelopt/onnx/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""Model optimization subpackage for onnx."""
1717

1818
import sys
19+
import warnings
1920

2021
MIN_PYTHON_VERSION = (3, 10)
2122

@@ -26,6 +27,12 @@
2627
raise ImportError(f"{e}\nPlease install optional ``[onnx]`` dependencies.")
2728

2829

30+
if sys.version_info < (3, 11):
31+
warnings.warn(
32+
"`modelopt.onnx` package will drop python<3.11 support in a future release",
33+
DeprecationWarning,
34+
)
35+
2936
# Check the current Python version
3037
if sys.version_info < MIN_PYTHON_VERSION:
3138
logger.warning(

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@
4848
"onnx-graphsurgeon",
4949
"onnx~=1.19.0",
5050
"onnxconverter-common~=1.16.0",
51-
"onnxruntime~=1.22.0 ; platform_machine == 'aarch64' or platform_system == 'Darwin'",
52-
"onnxruntime-gpu~=1.22.0 ; platform_machine != 'aarch64' and platform_system != 'Darwin'",
51+
# ORT with Python > 3.10
52+
"onnxruntime~=1.24.2 ; python_version > '3.10' and (platform_machine == 'aarch64' or platform_system == 'Darwin')", # noqa: E501
53+
"onnxruntime-gpu~=1.24.2 ; python_version > '3.10' and platform_machine != 'aarch64' and platform_system != 'Darwin' and platform_system != 'Windows'", # noqa: E501
54+
# ORT with Python <= 3.10
55+
"onnxruntime~=1.22.0 ; python_version <= '3.10' and (platform_machine == 'aarch64' or platform_system == 'Darwin')", # noqa: E501
56+
"onnxruntime-gpu~=1.22.0 ; python_version <= '3.10' and platform_machine != 'aarch64' and platform_system != 'Darwin' and platform_system != 'Windows'", # noqa: E501
57+
# ORT for Windows
58+
"onnxruntime-gpu==1.22.0; platform_system == 'Windows'",
5359
"onnxscript", # For autocast opset conversion and test_onnx_dynamo_export unit test
5460
"onnxslim>=0.1.76",
5561
"polygraphy>=0.49.22",

tests/unit/onnx/test_quantize_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
# onnxruntime version that supports opset 22+
3838
ORT_VERSION_FOR_OPSET_22 = version.parse("1.23.0")
39+
TORCH_VERSION_FOR_OPSET_22 = version.parse("2.8.0")
3940

4041

4142
# Test scenarios: (scenario_name, export_opset_offset, request_opset_offset, expected_opset_offset)
@@ -86,6 +87,11 @@ def test_quantize_opset_handling(
8687
pytest.skip(
8788
f"Opset {max_opset} requires onnxruntime >= {ORT_VERSION_FOR_OPSET_22}, have {ort_version}"
8889
)
90+
torch_version = version.parse(torch.__version__)
91+
if torch_version < TORCH_VERSION_FOR_OPSET_22:
92+
pytest.skip(
93+
f"Opset {max_opset} requires torch >= {TORCH_VERSION_FOR_OPSET_22}, have {torch_version}"
94+
)
8995

9096
# Setup: create and export model
9197
model_torch = SimpleMLP()

0 commit comments

Comments
 (0)