Skip to content

Commit e65ff7f

Browse files
committed
Added support for 3.10 with ORT 1.22 and deprecation warning for the future
Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com>
1 parent 353f2c7 commit e65ff7f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@
4848
"onnx-graphsurgeon",
4949
"onnx~=1.19.0",
5050
"onnxconverter-common~=1.16.0",
51-
"onnxruntime~=1.24.2 ; platform_machine == 'aarch64' or platform_system == 'Darwin'",
52-
"onnxruntime-gpu~=1.24.2 ; platform_machine != 'aarch64' and platform_system != 'Darwin' and platform_system != 'Windows'", # noqa: E501
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
5358
"onnxruntime-gpu==1.22.0; platform_system == 'Windows'",
5459
"onnxscript", # For autocast opset conversion and test_onnx_dynamo_export unit test
5560
"onnxslim>=0.1.76",

0 commit comments

Comments
 (0)