Skip to content

Commit 087045d

Browse files
hwangdeyufatcat-z
andauthored
Add support for Python310 and ORT 1.12 (#1975)
* python3.10 support Signed-off-by: Deyu Huang <[email protected]> * add tests except keras Signed-off-by: Deyu Huang <[email protected]> * add protubuf limit for tf 2.9.1 and ort to 1.12.0 Signed-off-by: Deyu Huang <[email protected]> * onnxruntime-extensions/yaml is not support with python3.10 Signed-off-by: Deyu Huang <[email protected]> * remove onnxruntime-extensions support in py310 Signed-off-by: Deyu Huang <[email protected]> Co-authored-by: Jay Zhang <[email protected]>
1 parent f30f41f commit 087045d

File tree

8 files changed

+37
-12
lines changed

8 files changed

+37
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The common issues we run into we try to document here [Troubleshooting Guide](Tr
1717

1818
| Build Type | OS | Python | TensorFlow | ONNX opset | Status |
1919
| --- | --- | --- | --- | --- | --- |
20-
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.7-3.9 | 1.13-1.15, 2.1-2.8 | 9-16 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=main) |
21-
| Unit Test - Full | Linux, MacOS, Windows | 3.7-3.9 | 1.13-1.15, 2.1-2.8 | 9-16 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=main) | |
20+
| Unit Test - Basic | Linux, MacOS<sup>\*</sup>, Windows<sup>\*</sup> | 3.7-3.10 | 1.13-1.15, 2.1-2.8 | 9-16 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=16&branchName=main) |
21+
| Unit Test - Full | Linux, MacOS, Windows | 3.7-3.10 | 1.13-1.15, 2.1-2.8 | 9-16 | [![Build Status](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_apis/build/status/unit_test-matrix?branchName=main)](https://dev.azure.com/tensorflow-onnx/tensorflow-onnx/_build/latest?definitionId=18&branchName=main) | |
2222
<br/>
2323

2424
## Supported Versions
@@ -42,7 +42,7 @@ You can install tf2onnx on top of tf-1.x or tf-2.x.
4242

4343
### Python
4444

45-
We support Python ```3.7-3.9```.
45+
We support Python ```3.7-3.10```.
4646
Note that on windows for Python > 3.7 the protobuf package doesn't use the cpp implementation and is very slow - we recommend to use Python 3.7 for that reason.
4747

4848
## Prerequisites

ci_build/azure_pipelines/pretrained_model_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- template: 'templates/job_generator.yml'
1717
parameters:
18-
# 2.7, tf
18+
# 2.8, tf
1919
python_versions: ['3.7']
2020
tf_versions: ['1.15.5','2.8.0']
2121
job:
@@ -24,7 +24,7 @@ jobs:
2424

2525
- template: 'templates/job_generator.yml'
2626
parameters:
27-
# 2.8, tf
27+
# 2.9, tf
2828
python_versions: ['3.9']
2929
tf_versions: ['2.9.1']
3030
job:

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
tf_versions: ['']
77
onnx_versions: ['']
88
onnx_opsets: ['16', '15', '14', '13', '12', '11', '10', '9']
9-
onnx_backends: {onnxruntime: ['1.11.0']}
9+
onnx_backends: {onnxruntime: ['1.12.0']}
1010
job: {}
1111
run_setup: 'True'
1212
report_coverage: 'False'

ci_build/azure_pipelines/templates/setup.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ steps:
66
pip install pytest pytest-cov pytest-runner coverage graphviz requests pyyaml pillow pandas parameterized sympy coloredlogs flatbuffers
77
pip install $(CI_PIP_TF_NAME) $(CI_PIP_ONNX_NAME)
88
9-
# protobuf release version 4.21.0 has some Python changes which is not compatible with tensorflow so far.
9+
# Protobuf 3.20 results in linker errors on Windows in TF.
10+
# Protobuf 4.0 is binary incompatible with what C++ TF uses.
11+
# https://github.com/tensorflow/tensorflow/blob/c3337c73306b2b859d82fe130912f18e6a1c5c23/tensorflow/tools/pip_package/setup.py#L88
1012
pip uninstall -y protobuf
11-
pip install "protobuf<4.21.0"
13+
pip install "protobuf<3.20.0"
1214
1315
# TF < 2.7 reuires numpy <= 1.19, but onnxruntime >= 1.11 requires numpy >= 1.21
1416
if [[ $CI_TF_VERSION < 2.7 ]] && [[ $CI_ONNX_BACKEND == "onnxruntime" ]] ;
@@ -40,7 +42,12 @@ steps:
4042
4143
if [[ $CI_TF_VERSION == 2.* ]] ;
4244
then
43-
pip install onnxruntime-extensions==0.3.1
45+
# onnxruntime-extensions is not supported Python 3.10 so far.
46+
# https://github.com/microsoft/onnxruntime-extensions/issues/273
47+
if [[ $CI_PYTHON_VERSION != 3.10 ]] ;
48+
then
49+
pip install onnxruntime-extensions==0.3.1
50+
fi
4451
if [[ $CI_TF_VERSION == 2.3* ]] ;
4552
then
4653
pip install tensorflow-text==${CI_TF_VERSION}
@@ -64,6 +71,10 @@ steps:
6471
if [[ $CI_TF_VERSION == 2.8* ]] ;
6572
then
6673
pip install "tensorflow-text>=2.8,<2.9"
74+
fi
75+
if [[ $CI_TF_VERSION == 2.9* ]] ;
76+
then
77+
pip install "tensorflow-text>=2.9,<2.10"
6778
else
6879
pip install tensorflow-text
6980
fi

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ stages:
5050
- template: 'templates/job_generator.yml'
5151
parameters:
5252
platforms: ['linux', 'windows']
53-
python_versions: ['3.9']
53+
python_versions: ['3.9', '3.10']
5454
tf_versions: ['2.8.0']
5555
onnx_opsets: ['']
5656
job:

ci_build/azure_pipelines/unit_test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ stages:
106106
- template: 'templates/job_generator.yml'
107107
parameters:
108108
# tf 2.9
109-
python_versions: ['3.8']
109+
python_versions: ['3.10']
110110
tf_versions: ['2.9.1']
111111
onnx_opsets: ['']
112112
job:
@@ -168,5 +168,16 @@ stages:
168168
- template: 'unit_test.yml'
169169
report_coverage: 'True'
170170

171+
- template: 'templates/job_generator.yml'
172+
parameters:
173+
python_versions: ['3.10']
174+
platforms: ['windows']
175+
tf_versions: ['2.9.1']
176+
onnx_opsets: ['16']
177+
job:
178+
steps:
179+
- template: 'unit_test.yml'
180+
report_coverage: 'True'
181+
171182
- template: 'templates/combine_test_coverage.yml'
172183

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ def run(self):
9797
'Programming Language :: Python :: 3',
9898
'Programming Language :: Python :: 3.7',
9999
'Programming Language :: Python :: 3.8',
100-
'Programming Language :: Python :: 3.9']
100+
'Programming Language :: Python :: 3.9',
101+
'Programming Language :: Python :: 3.10']
101102
)

tests/test_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,8 @@ def func(x, y):
32333233
y_val = np.array(i / 10, np.float32)
32343234
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val, _INPUT1: y_val}, rtol=1e-6, atol=2e-5)
32353235

3236+
# https://github.com/microsoft/onnxruntime/issues/12302
3237+
@skip_onnxruntime_backend("resize op can't work well under Cubic mode with ORT 1.12")
32363238
@check_tf_min_version("2.0", "Results are slightly different in tf1")
32373239
@check_opset_min_version(11, "resize bicubic")
32383240
def test_resize_bicubic(self):

0 commit comments

Comments
 (0)