-
Notifications
You must be signed in to change notification settings - Fork 299
230 lines (218 loc) · 7.89 KB
/
Copy pathexamples.yml
File metadata and controls
230 lines (218 loc) · 7.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Test examples
run-name: "Test examples${{ inputs.pr_num != '' && format(' PR#{0}', inputs.pr_num) || '' }}${{ inputs.pytest_args != '' && format(' [{0}]', inputs.pytest_args) || '' }}"
permissions: read-all
on:
workflow_call:
inputs:
pr_num:
description: 'The pull request number'
type: string
default: ''
pytest_args:
description: 'Pytest arguments'
type: string
default: ''
skip_windows:
description: 'Skip tests on Windows'
type: boolean
default: false
skip_gpu:
description: 'Skip tests on GPU'
type: boolean
default: false
workflow_dispatch:
inputs:
pr_num:
description: 'The pull request number'
default: ''
pytest_args:
description: 'Pytest arguments'
default: ''
skip_windows:
description: 'Skip tests on Windows'
type: boolean
default: false
skip_gpu:
description: 'Skip tests on GPU'
type: boolean
default: false
defaults:
run:
shell: bash
env:
PYTEST_ARGS: ${{ inputs.pytest_args || '' }}
TQDM_DISABLE: 1
RESULT_XML: "pytest-results.xml"
PYTHON_VERSION: "3.12"
jobs:
examples-cpu:
name: Test examples CPU [${{ matrix.group }}/6]
runs-on: ubuntu-latest-16-cores
timeout-minutes: 80
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ inputs.pr_num != '' && format('refs/pull/{0}/head', inputs.pr_num) || github.ref }}
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: cpuinfo
run: cat /proc/cpuinfo
- name: Install test requirements
run: |
pip install -r tests/cross_fw/examples/requirements.txt
- name: Print installed modules
run: pip list
- name: Run examples test scope
run: |
set +e
python -m pytest -s -ra tests/cross_fw/examples \
-m 'not cuda' \
--junit-xml=${{ env.RESULT_XML }} \
--durations-path=tests/cross_fw/examples/test_durations.json \
--splitting-algorithm=least_duration \
--splits 6 \
--group ${{ matrix.group }} \
${{ env.PYTEST_ARGS }}
ret=$?
[ $ret -eq 5 ] && [ -n "${{ inputs.pytest_args || '' }}" ] && exit 0 || exit $ret
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: examples-cpu-pytest-results-${{ matrix.group }}
path: ${{ env.RESULT_XML }}
retention-days: 7
examples-cuda:
name: Test examples CUDA [${{ matrix.group }}/1]
runs-on: aks-linux-6-cores-55gb-gpu-a10
timeout-minutes: 40
if: ${{ !inputs.skip_gpu }}
strategy:
fail-fast: false
matrix:
group: [1]
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get --assume-yes install build-essential ninja-build libgl1-mesa-dev libglib2.0-0 wget make
- name: Download CUDA
run: |
wget -q https://developer.download.nvidia.com/compute/cuda/12.6.3/local_installers/cuda_12.6.3_560.35.05_linux.run
sudo sh cuda_12.6.3_560.35.05_linux.run --toolkit --silent
- name: Runner info
continue-on-error: true
run: |
nvidia-smi
cat /proc/cpuinfo
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ inputs.pr_num != '' && format('refs/pull/{0}/head', inputs.pr_num) || github.ref }}
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: cpuinfo
run: cat /proc/cpuinfo
- name: Install test requirements
run: |
pip install -r tests/cross_fw/examples/requirements.txt
- name: Print installed modules
run: pip list
- name: Run examples test scope
run: |
set +e
python -m pytest -s -ra tests/cross_fw/examples \
-m cuda \
--junit-xml=${{ env.RESULT_XML }} \
--durations-path=tests/cross_fw/examples/test_durations.json \
--splitting-algorithm=least_duration \
--splits 1 \
--group ${{ matrix.group }} \
${{ env.PYTEST_ARGS }}
ret=$?
[ $ret -eq 5 ] && [ -n "${{ inputs.pytest_args || '' }}" ] && exit 0 || exit $ret
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: examples-cuda-pytest-results-${{ matrix.group }}
path: ${{ env.RESULT_XML }}
retention-days: 7
examples-win-cpu:
name: Test examples CPU Windows [${{ matrix.group }}/6]
runs-on: windows-2025-16-core
timeout-minutes: 80
if: ${{ !inputs.skip_windows }}
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
env:
PYTHONIOENCODING: utf-8
NNCF_EXTENSION_LOAD_TIMEOUT: 180
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ inputs.pr_num != '' && format('refs/pull/{0}/head', inputs.pr_num) || github.ref }}
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Install NNCF and test requirements
run: |
pip install -r tests/cross_fw/examples/requirements.txt
- name: Print installed modules
run: pip list
- name: Run examples test scope
run: |
set +e
sys_lib="$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")"
prefix_lib="$(python -c "import sys; print(sys.prefix + '/libs')")"
include_dir="$(python -c "import sysconfig; print(sysconfig.get_path('include'))")"
export LIB="${LIB};${sys_lib};${prefix_lib}"
export INCLUDE="${INCLUDE};${include_dir}"
python -m pytest -s -ra tests/cross_fw/examples \
-m 'not cuda' \
--junit-xml=${{ env.RESULT_XML }} \
--durations-path=tests/cross_fw/examples/test_durations.json \
--splitting-algorithm=least_duration \
--splits 6 \
--group ${{ matrix.group }} \
${{ env.PYTEST_ARGS }}
ret=$?
[ $ret -eq 5 ] && [ -n "${{ inputs.pytest_args || '' }}" ] && exit 0 || exit $ret
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: examples-win-cpu-pytest-results-${{ matrix.group }}
path: ${{ env.RESULT_XML }}
retention-days: 7
examples-cpu-summary:
name: Summary Examples CPU
if: ${{ !cancelled() }}
needs: examples-cpu
uses: ./.github/workflows/call_summary.yml
with:
artifact_pattern: examples-cpu-pytest-results-*
examples-cuda-summary:
name: Summary Examples CUDA
if: ${{ !cancelled() && !inputs.skip_gpu }}
needs: examples-cuda
uses: ./.github/workflows/call_summary.yml
with:
artifact_pattern: examples-cuda-pytest-results-*
examples-win-cpu-summary:
name: Summary Examples Windows CPU
if: ${{ !cancelled() && !inputs.skip_windows }}
needs: examples-win-cpu
uses: ./.github/workflows/call_summary.yml
with:
artifact_pattern: examples-win-cpu-pytest-results-*