-
Notifications
You must be signed in to change notification settings - Fork 177
418 lines (360 loc) · 14.2 KB
/
mac.yml
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: macOS (12, Python 3.9)
on:
workflow_dispatch:
pull_request:
merge_group:
push:
branches:
- master
- 'releases/**'
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
concurrency:
# github.ref is not unique in post-commit
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-mac
cancel-in-progress: true
env:
PYTHON_VERSION: '3.9'
OV_BRANCH: 0080d90974ca84f9a6d359da3388a2a18a93b753
OV_TARBALL: ''
jobs:
openvino_download:
name: Download OpenVINO package
outputs:
status: ${{ steps.openvino_download.outcome }}
timeout-minutes: 10
defaults:
run:
shell: bash
runs-on: ubuntu-20.04
steps:
- name: Download OpenVINO build
id: openvino_download
run: |
wget ${{ env.OV_TARBALL}} --progress=bar:force:noscroll -O openvino_package.tar.gz
tar -tvf openvino_package.tar.gz
continue-on-error: true
#
# Upload to artifacts
#
- name: Upload openvino package
if: steps.openvino_download.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: openvino_package
path: openvino_package.tar.gz
if-no-files-found: 'error'
openvino_build:
name: Build OpenVINO package
needs: [openvino_download]
if: needs.openvino_download.outputs.status != 'success'
timeout-minutes: 150
defaults:
run:
shell: bash
runs-on: 'macos-12-large'
env:
MACOSX_DEPLOYMENT_TARGET: '10.15'
CMAKE_BUILD_TYPE: 'Release'
CMAKE_GENERATOR: 'Ninja Multi-Config'
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
OPENVINO_REPO: ${{ github.workspace }}/openvino
INSTALL_DIR: ${{ github.workspace }}/openvino/install
BUILD_DIR: ${{ github.workspace }}/openvino/build
steps:
- name: Clone OpenVINO
uses: actions/checkout@v4
with:
repository: 'openvinotoolkit/openvino'
path: ${{ env.OPENVINO_REPO }}
submodules: 'true'
ref: ${{ env.OV_BRANCH }}
#
# Dependencies
#
- name: Install build dependencies
run: brew install coreutils ninja
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install python dependencies
run: |
# For Python API: build and wheel packaging
python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
#
# Build
#
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: "2000M"
# Should save cache only if run in the master branch of the base repo
# github.ref_name is 'ref/PR_#' in case of the PR, and 'branch_name' when executed on push
save: ${{ github.ref_name == 'master' && 'true' || 'false' }}
verbose: 2
key: ccache-mac
restore-keys: |
ccache-mac
- name: CMake configure - OpenVINO
run: |
cmake \
-G "${{ env.CMAKE_GENERATOR }}" \
-DENABLE_CPPLINT=OFF \
-DENABLE_NCC_STYLE=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_STRICT_DEPENDENCIES=OFF \
-DENABLE_SYSTEM_OPENCL=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCPACK_GENERATOR=TGZ \
-DENABLE_JS=OFF \
-DENABLE_SAMPLES=ON \
-DENABLE_OV_ONNX_FRONTEND=OFF \
-DENABLE_OV_PADDLE_FRONTEND=OFF \
-DENABLE_OV_PYTORCH_FRONTEND=ON \
-DENABLE_OV_TF_FRONTEND=ON \
-DENABLE_OV_TF_LITE_FRONTEND=OFF \
-DENABLE_INTEL_GPU=OFF \
-DENABLE_INTEL_NPU=OFF \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DENABLE_PYTHON=ON \
-DENABLE_WHEEL=ON \
-S ${OPENVINO_REPO} \
-B ${BUILD_DIR}
- name: Clean ccache stats
run: ccache --zero-stats --show-config
- name: Cmake build - OpenVINO
run: cmake --build ${BUILD_DIR} --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
- name: Show ccache stats
run: ccache --show-stats
- name: Cmake install - OpenVINO
run: |
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -P ${BUILD_DIR}/cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/openvino_package -DCOMPONENT=python_wheels -P ${BUILD_DIR}/cmake_install.cmake
- name: Pack Artifacts
run: |
pushd ${INSTALL_DIR}
tar -czvf ${BUILD_DIR}/openvino_package.tar.gz *
popd
#
# Upload build artifacts and logs
#
- name: Upload openvino package
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: openvino_package
path: ${{ env.BUILD_DIR }}/openvino_package.tar.gz
if-no-files-found: 'error'
genai_python_lib:
name: OpenVINO genai extension (cmake + wheel)
needs: [ openvino_download, openvino_build ]
if: |
always() &&
(needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success')
timeout-minutes: 90
defaults:
run:
shell: bash
runs-on: macos-13
env:
OV_INSTALL_DIR: ${{ github.workspace }}/ov
MACOSX_DEPLOYMENT_TARGET: '11.0'
steps:
- name: Clone openvino.genai
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
name: openvino_package
path: ${{ env.OV_INSTALL_DIR }}
- name: Extract OpenVINO packages
run: |
pushd ${OV_INSTALL_DIR}
tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1
popd
- name: Install build dependencies
run: brew install coreutils ninja scons
- name: Build genai
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release -j
- name: Test bindings
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/wheels --upgrade-strategy eager
python -m pytest -v ./tests/python_tests/test_chat_generate_api.py::test_set_chat_template
env:
PYTHONPATH: "./build/:$PYTHONPATH"
- name: Test bindings (wheel)
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/wheels
python -c "from openvino_genai import LLMPipeline"
python -m pytest -v ./tests/python_tests/ --ignore ./tests/python_tests/test_whisper_generate_api.py --ignore ./tests/python_tests/test_vlm_api.py -k "not test_set_chat_template"
genai_python_lib_whisper:
name: OpenVINO genai extension whisper tests (cmake + wheel)
needs: [ openvino_download, openvino_build ]
if: |
always() &&
(needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success')
timeout-minutes: 90
defaults:
run:
shell: bash
runs-on: macos-13
env:
OV_INSTALL_DIR: ${{ github.workspace }}/ov
MACOSX_DEPLOYMENT_TARGET: '11.0'
steps:
- name: Clone openvino.genai
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
name: openvino_package
path: ${{ env.OV_INSTALL_DIR }}
- name: Extract OpenVINO packages
run: |
pushd ${OV_INSTALL_DIR}
tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1
popd
- name: Install build dependencies
run: brew install coreutils ninja scons
- name: Build genai
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
cmake --build ./build/ --config Release --target py_openvino_genai -j
- name: Test bindings
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./tests/python_tests/requirements.txt --find-links ${OV_INSTALL_DIR}/wheels --upgrade-strategy eager
python -m pytest -v ./tests/python_tests/test_whisper_generate_api.py -k test_smoke
env:
PYTHONPATH: "./build/:$PYTHONPATH"
- name: Test bindings (wheel)
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
python -m pip install . --verbose --find-links ${OV_INSTALL_DIR}/wheels
python -c "from openvino_genai import LLMPipeline"
python -m pytest -v ./tests/python_tests/test_whisper_generate_api.py -k "not test_smoke"
genai_package:
name: OpenVINO genai extension (install to OpenVINO package)
strategy:
matrix:
build-type: [Release, Debug]
needs: [ openvino_download, openvino_build ]
if: |
always() &&
(needs.openvino_download.outputs.status == 'success' || needs.openvino_build.result == 'success')
timeout-minutes: 30
defaults:
run:
shell: bash
runs-on: macos-13
env:
OV_INSTALL_DIR: ${{ github.workspace }}/ov
steps:
- name: Clone openvino.genai
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
name: openvino_package
path: ${{ env.OV_INSTALL_DIR }}
- name: Extract OpenVINO packages
run: |
pushd ${OV_INSTALL_DIR}
tar -xzf openvino_package.tar.gz -C ${OV_INSTALL_DIR} --strip-components=1
popd
- name: Install build dependencies
run: brew install coreutils scons
- name: Build genai
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/
cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j
- name: Build and Install dependencies
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --find-links ${OV_INSTALL_DIR}/wheels
python -m pip install --upgrade-strategy eager -r ./samples/requirements.txt --find-links ${OV_INSTALL_DIR}/wheels
optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0
optimum-cli export openvino --trust-remote-code --model openai/whisper-tiny whisper-tiny
- name: Install samples
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ${OV_INSTALL_DIR}
- name: Build samples (Release)
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build
run: |
${OV_INSTALL_DIR}/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace
- name: Build samples (Debug)
if: ${{ 'Release' != matrix.build-type }}
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${OV_INSTALL_DIR}/samples/cpp/ -B ./samples\ build/
cmake --build ./samples\ build/ --config ${{ matrix.build-type }} -j
cmake --install ./samples\ build/ --config ${{ matrix.build-type }} --component samples_bin --prefix s\ pace
- name: Test C++ samples (greedy_causal_lm)
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ ""
timeout-minutes: 1
- name: Test C++ samples (whisper_speech_recognition)
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
wget https://storage.openvinotoolkit.org/models_contrib/speech/2021.2/librispeech_s5/how_are_you_doing_today.wav
${{ github.workspace }}/s\ pace/samples_bin/whisper_speech_recognition ./whisper-tiny/ how_are_you_doing_today.wav
timeout-minutes: 1
- name: Test python samples (multinomial_causal_lm)
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
${OV_INSTALL_DIR}/samples/python/multinomial_causal_lm/multinomial_causal_lm.py ./TinyLlama-1.1B-Chat-v1.0/ 0
timeout-minutes: 1
- name: Test python samples (whisper_speech_recognition)
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
run: |
source ${OV_INSTALL_DIR}/setupvars.sh
${OV_INSTALL_DIR}/samples/python/whisper_speech_recognition/whisper_speech_recognition.py ./whisper-tiny/ how_are_you_doing_today.wav
timeout-minutes: 1
Overall_Status:
name: ci/gha_overall_status_macos
needs: [openvino_download, openvino_build, genai_python_lib, genai_package, genai_python_lib_whisper]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check status of all jobs
if: >-
${{
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
}}
run: exit 1