Skip to content

Commit 55d001a

Browse files
authored
Enable tensorflow 2.8.0 in CI pipeline. (#1863)
* Make changes to support running tests with tf2.8.0 in CI pipeline. * Enable tf 2.8.0 in CI pipeline. * Install tensorflow-text for tf 2.8.x version. * Add support for new TFL ops required by tf 2.8.0. Signed-off-by: Jay Zhang <[email protected]>
1 parent bf4a22d commit 55d001a

19 files changed

+316
-14
lines changed

ci_build/azure_pipelines/onnxruntime_nightly_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ stages:
6868
parameters:
6969
platforms: ['linux']
7070
python_versions: ['3.9']
71-
tf_versions: ['2.5.0']
71+
tf_versions: ['2.8.0']
7272
onnx_opsets: ['']
7373
onnx_backends: {onnxruntime: ['nightly']}
7474
job:

ci_build/azure_pipelines/pretrained_model_test-matrix.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,29 @@ jobs:
2828
steps:
2929
- template: 'pretrained_model_test.yml'
3030

31+
- template: 'templates/job_generator.yml'
32+
parameters:
33+
platforms: ['linux', 'windows']
34+
python_versions: ['3.9']
35+
tf_versions: ['2.6.2']
36+
job:
37+
steps:
38+
- template: 'pretrained_model_test.yml'
39+
3140
- template: 'templates/job_generator.yml'
3241
parameters:
3342
platforms: ['linux', 'windows']
3443
python_versions: ['3.8']
35-
tf_versions: ['2.5.0']
44+
tf_versions: ['2.7.0']
3645
job:
3746
steps:
3847
- template: 'pretrained_model_test.yml'
3948

4049
- template: 'templates/job_generator.yml'
4150
parameters:
4251
platforms: ['linux', 'windows']
43-
python_versions: ['3.9']
44-
tf_versions: ['2.6.2']
52+
python_versions: ['3.8']
53+
tf_versions: ['2.8.0']
4554
job:
4655
steps:
4756
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/pretrained_model_test.yml

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

1616
- template: 'templates/job_generator.yml'
1717
parameters:
18-
# 2.6, tf
18+
# 2.7, tf
1919
python_versions: ['3.7']
20-
tf_versions: ['1.15.5','2.6.2']
20+
tf_versions: ['1.15.5','2.7.0']
2121
job:
2222
steps:
2323
- template: 'pretrained_model_test.yml'
2424

2525
- template: 'templates/job_generator.yml'
2626
parameters:
27-
# 2.7, tf
27+
# 2.8, tf
2828
python_versions: ['3.9']
29-
tf_versions: ['2.7.0']
29+
tf_versions: ['2.8.0']
3030
job:
3131
steps:
3232
- template: 'pretrained_model_test.yml'

ci_build/azure_pipelines/templates/keras2onnx_application_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ steps:
2020
conda config --set always_yes yes --set changeps1 no
2121
pip install $(ONNX_PATH)
2222
pip install h5py==2.9.0
23-
pip install numpy==1.19
2423
pip install parameterized
2524
$(INSTALL_TENSORFLOW)
2625
$(INSTALL_KERAS)
@@ -82,7 +81,6 @@ steps:
8281
pip uninstall -y protobuf
8382
pip install protobuf
8483
pip install h5py==2.9.0
85-
pip install numpy==1.19
8684
pip install parameterized
8785
%INSTALL_TENSORFLOW%
8886
%INSTALL_KERAS%

ci_build/azure_pipelines/templates/keras2onnx_unit_test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ steps:
2020
conda config --set always_yes yes --set changeps1 no
2121
pip install $(ONNX_PATH)
2222
pip install h5py==2.9.0
23-
pip install numpy==1.19
2423
pip install parameterized
2524
pip install $(TENSORFLOW_PATH)
2625
if [[ ! -z $KERAS ]];

ci_build/azure_pipelines/templates/setup.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ steps:
4949
then
5050
pip install "tensorflow-text>=2.7,<2.8"
5151
fi
52+
if [[ $CI_TF_VERSION == 2.8* ]] ;
53+
then
54+
pip install "tensorflow-text>=2.8,<2.9"
55+
fi
5256
fi
5357
5458
python setup.py install

ci_build/azure_pipelines/trimmed_keras2onnx_unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
TENSORFLOW_PATH: tensorflow==1.15.0
5555
INSTALL_ORT: pip install onnxruntime==1.9.0
5656

57-
Python37-tf2.3:
57+
Python37-tf2.8:
5858
python.version: '3.7'
5959
ONNX_PATH: onnx==1.10.2
6060
TENSORFLOW_PATH: tensorflow-cpu==2.3.0

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,15 @@ stages:
5858
- template: 'unit_test.yml'
5959
report_coverage: 'True'
6060

61+
- template: 'templates/job_generator.yml'
62+
parameters:
63+
platforms: ['linux', 'windows']
64+
python_versions: ['3.8']
65+
tf_versions: ['2.8.0']
66+
onnx_opsets: ['']
67+
job:
68+
steps:
69+
- template: 'unit_test.yml'
70+
report_coverage: 'True'
71+
6172
- template: 'templates/combine_test_coverage.yml'

ci_build/azure_pipelines/unit_test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,43 @@
33
stages:
44
- stage:
55
jobs:
6+
- template: 'templates/job_generator.yml'
7+
parameters:
8+
# TFJS tf 2.8
9+
python_versions: ['3.9']
10+
tf_versions: ['2.8.0']
11+
onnx_opsets: ['']
12+
skip_tfjs_tests: 'False'
13+
skip_tf_tests: 'True'
14+
job:
15+
steps:
16+
- template: 'unit_test.yml'
17+
report_coverage: 'True'
18+
19+
- template: 'templates/job_generator.yml'
20+
parameters:
21+
# TFLite tf 2.8
22+
python_versions: ['3.8']
23+
tf_versions: ['2.8.0']
24+
onnx_opsets: ['']
25+
skip_tflite_tests: 'False'
26+
skip_tf_tests: 'True'
27+
job:
28+
steps:
29+
- template: 'unit_test.yml'
30+
report_coverage: 'True'
31+
32+
- template: 'templates/job_generator.yml'
33+
parameters:
34+
# tf 2.8
35+
python_versions: ['3.8']
36+
tf_versions: ['2.8.0']
37+
onnx_opsets: ['']
38+
job:
39+
steps:
40+
- template: 'unit_test.yml'
41+
report_coverage: 'True'
42+
643
- template: 'templates/job_generator.yml'
744
parameters:
845
# TFJS tf 2.7

tests/test_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def func(x):
305305
def test_multinomial(self):
306306
x_val = np.array([[10., 10.]], dtype=np.float32)
307307
def func(x):
308-
op = multinomial(tf.math.log(x), 5, output_dtype=tf.int64)
308+
op = multinomial(tf.math.log(x), 5, output_dtype=tf.int32)
309309
return tf.identity(op, name=_TFOUTPUT)
310310

311311
# since returned indexes are random we can only check type and shape
@@ -318,7 +318,7 @@ def test_multinomial1(self):
318318
shape = [2, 10]
319319
x_val = np.ones(np.prod(shape)).astype("float32").reshape(shape)
320320
def func(x):
321-
op = multinomial(x, 2, output_dtype=tf.int64)
321+
op = multinomial(x, 2, output_dtype=tf.int32)
322322
return tf.identity(op, name=_TFOUTPUT)
323323
# since returned indexes are random we can only check type and shape
324324
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val}, check_value=False,

0 commit comments

Comments
 (0)