Skip to content

Commit a607275

Browse files
Enabled tflite support and tests (#1297)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent 70529a5 commit a607275

File tree

12 files changed

+352
-155
lines changed

12 files changed

+352
-155
lines changed

ci_build/azure_pipelines/templates/job_generator.yml

Lines changed: 36 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ parameters:
1111
run_setup: 'True'
1212
report_coverage: 'False'
1313
artifact_name: 'single_test_coverage'
14+
skip_tflite_tests: 'True'
15+
skip_tf_tests: 'False'
1416

1517
jobs:
1618
- job: ${{ parameters.job.name }}
@@ -27,73 +29,42 @@ jobs:
2729
${{ each onnx_backend in parameters.onnx_backends }}:
2830
${{ each onnx_backend_version in onnx_backend.value }}:
2931
${{ each onnx_opset in parameters.onnx_opsets }}:
30-
${{ if ne(onnx_opset, '') }}:
31-
${{ format('{0} python{1} tf{2} onnx{3} opset{4} {5}{6}', platform, python_version, tf_version, onnx_version, onnx_opset, onnx_backend.key, onnx_backend_version) }}:
32-
${{ if eq(platform, 'linux') }}:
33-
CI_VM_IMAGE: 'ubuntu-16.04'
34-
${{ if eq(platform, 'windows') }}:
35-
CI_VM_IMAGE: 'vs2017-win2016'
36-
${{ if eq(platform, 'mac') }}:
37-
CI_VM_IMAGE: 'macOS-10.13'
38-
CI_PYTHON_VERSION: '${{ python_version }}'
39-
CI_TF_VERSION: '${{ tf_version }}'
40-
CI_ONNX_VERSION: '${{ onnx_version }}'
32+
${{ format('{0} python{1}{2} tf{3} onnx{4} {5}{6}{7}', platform, python_version, replace(replace(parameters.skip_tflite_tests,'True', ''), 'False', ' tflite'), tf_version, onnx_version, replace(format('opset{0} ', onnx_opset), 'opset ', ''), onnx_backend.key, onnx_backend_version) }}:
33+
${{ if eq(platform, 'linux') }}:
34+
CI_VM_IMAGE: 'ubuntu-16.04'
35+
${{ if eq(platform, 'windows') }}:
36+
CI_VM_IMAGE: 'vs2017-win2016'
37+
${{ if eq(platform, 'mac') }}:
38+
CI_VM_IMAGE: 'macOS-10.13'
39+
CI_PLATFORM: '${{ platform }}'
40+
CI_PYTHON_VERSION: '${{ python_version }}'
41+
CI_TF_VERSION: '${{ tf_version }}'
42+
CI_ONNX_VERSION: '${{ onnx_version }}'
43+
${{ if ne(onnx_opset, '') }}:
4144
CI_ONNX_OPSET: '${{ onnx_opset }}'
42-
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
43-
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
44-
45-
${{ if eq(tf_version, '') }}:
46-
CI_PIP_TF_NAME: 'tensorflow'
47-
${{ if ne(tf_version, '') }}:
48-
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
49-
50-
${{ if eq(onnx_version, '') }}:
51-
CI_PIP_ONNX_NAME: 'onnx'
52-
${{ if ne(onnx_version, '') }}:
53-
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
54-
55-
${{ if eq(onnx_backend_version, '') }}:
56-
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
57-
${{ if ne(onnx_backend_version, '') }}:
58-
${{ if ne(onnx_backend_version, 'nightly') }}:
59-
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
60-
${{ if eq(onnx_backend_version, 'nightly') }}:
61-
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
62-
CI_ONNXRUNTIME_NIGHTLY: 'true'
63-
64-
${{ if eq(onnx_opset, '') }}:
65-
${{ format('{0} python{1} tf{2} onnx{3} {4}{5}', platform, python_version, tf_version, onnx_version, onnx_backend.key, onnx_backend_version) }}:
66-
${{ if eq(platform, 'linux') }}:
67-
CI_VM_IMAGE: 'ubuntu-16.04'
68-
${{ if eq(platform, 'windows') }}:
69-
CI_VM_IMAGE: 'vs2017-win2016'
70-
${{ if eq(platform, 'mac') }}:
71-
CI_VM_IMAGE: 'macOS-10.13'
72-
CI_PLATFORM: '${{ platform }}'
73-
CI_PYTHON_VERSION: '${{ python_version }}'
74-
CI_TF_VERSION: '${{ tf_version }}'
75-
CI_ONNX_VERSION: '${{ onnx_version }}'
76-
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
77-
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
78-
79-
${{ if eq(tf_version, '') }}:
80-
CI_PIP_TF_NAME: 'tensorflow'
81-
${{ if ne(tf_version, '') }}:
82-
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
83-
84-
${{ if eq(onnx_version, '') }}:
85-
CI_PIP_ONNX_NAME: 'onnx'
86-
${{ if ne(onnx_version, '') }}:
87-
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
88-
89-
${{ if eq(onnx_backend_version, '') }}:
45+
CI_ONNX_BACKEND: '${{ onnx_backend.key }}'
46+
CI_ONNX_BACKEND_VERSION: '${{ onnx_backend_version }}'
47+
CI_SKIP_TF_TESTS: '${{ parameters.skip_tf_tests }}'
48+
CI_SKIP_TFLITE_TESTS: '${{ parameters.skip_tflite_tests }}'
49+
50+
${{ if eq(tf_version, '') }}:
51+
CI_PIP_TF_NAME: 'tensorflow'
52+
${{ if ne(tf_version, '') }}:
53+
CI_PIP_TF_NAME: ${{ format('tensorflow=={0}', tf_version) }}
54+
55+
${{ if eq(onnx_version, '') }}:
56+
CI_PIP_ONNX_NAME: 'onnx'
57+
${{ if ne(onnx_version, '') }}:
58+
CI_PIP_ONNX_NAME: ${{ format('onnx=={0}', onnx_version) }}
59+
60+
${{ if eq(onnx_backend_version, '') }}:
61+
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
62+
${{ if ne(onnx_backend_version, '') }}:
63+
${{ if ne(onnx_backend_version, 'nightly') }}:
64+
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
65+
${{ if eq(onnx_backend_version, 'nightly') }}:
9066
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
91-
${{ if ne(onnx_backend_version, '') }}:
92-
${{ if ne(onnx_backend_version, 'nightly') }}:
93-
CI_PIP_ONNX_BACKEND_NAME: ${{ format('{0}=={1}', onnx_backend.key, onnx_backend_version) }}
94-
${{ if eq(onnx_backend_version, 'nightly') }}:
95-
CI_PIP_ONNX_BACKEND_NAME: '${{ onnx_backend.key }}'
96-
CI_ONNXRUNTIME_NIGHTLY: 'true'
67+
CI_ONNXRUNTIME_NIGHTLY: 'true'
9768

9869
# Insert all properties other than pool/steps/strategy
9970
${{ each pair in parameters.job }}:

ci_build/azure_pipelines/templates/unit_test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22

33
parameters:
44
onnx_opsets: ['13', '12', '11', '10', '9', '8', '7']
5+
skip_tflite_tests: 'True'
6+
skip_tf_tests: 'False'
57

68
steps:
79
- ${{ each onnx_opset in parameters.onnx_opsets }}:
810
- bash: |
911
export TF2ONNX_TEST_BACKEND=$CI_ONNX_BACKEND
1012
export TF2ONNX_TEST_OPSET=$CI_ONNX_OPSET
13+
export TF2ONNX_SKIP_TFLITE_TESTS=$CI_SKIP_TFLITE_TESTS
14+
export TF2ONNX_SKIP_TF_TESTS=$CI_SKIP_TF_TESTS
1115
python -m pytest --cov=tf2onnx --cov-report=term --disable-pytest-warnings -r s tests --cov-append
1216
timeoutInMinutes: 15
1317
displayName: ${{ format('Run UnitTest - Opset{0}', onnx_opset) }}
1418
condition: succeededOrFailed()
1519
env:
1620
CI_ONNX_OPSET: '${{ onnx_opset }}'
21+
CI_SKIP_TFLITE_TESTS: '${{ parameters.skip_tflite_tests }}'
22+
CI_SKIP_TF_TESTS: '${{ parameters.skip_tf_tests }}'

ci_build/azure_pipelines/unit_test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stages:
66
- template: 'templates/job_generator.yml'
77
parameters:
88
platforms: ['linux', 'windows']
9-
python_versions: [3.6']
9+
python_versions: ['3.6']
1010
tf_versions: ['1.13.1', '1.12.3']
1111
onnx_opsets: ['']
1212
job:

ci_build/azure_pipelines/unit_test.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
stages:
44
- stage:
55
jobs:
6+
- template: 'templates/job_generator.yml'
7+
parameters:
8+
python_versions: ['3.8']
9+
tf_versions: ['2.4.0']
10+
onnx_opsets: ['']
11+
skip_tflite_tests: 'False'
12+
skip_tf_tests: 'True'
13+
job:
14+
steps:
15+
- template: 'unit_test.yml'
16+
report_coverage: 'True'
17+
18+
- template: 'templates/job_generator.yml'
19+
parameters:
20+
python_versions: ['3.7']
21+
tf_versions: ['2.3.0']
22+
onnx_opsets: ['']
23+
skip_tflite_tests: 'False'
24+
skip_tf_tests: 'True'
25+
job:
26+
steps:
27+
- template: 'unit_test.yml'
28+
report_coverage: 'True'
29+
630
- template: 'templates/job_generator.yml'
731
parameters:
832
python_versions: ['3.8']
@@ -32,7 +56,7 @@ stages:
3256
steps:
3357
- template: 'unit_test.yml'
3458
report_coverage: 'True'
35-
59+
3660
- template: 'templates/job_generator.yml'
3761
parameters:
3862
platforms: ['windows']

0 commit comments

Comments
 (0)