-
Notifications
You must be signed in to change notification settings - Fork 21
285 lines (242 loc) · 8.84 KB
/
windows.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
name: Windows (VS 2019, Python 3.11)
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- 'releases/**'
concurrency:
# github.ref is not unique in post-commit
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-windows
cancel-in-progress: true
env:
PYTHON_VERSION: '3.11'
jobs:
openvino_build:
timeout-minutes: 150
defaults:
run:
shell: pwsh
runs-on: windows-2019-16-core
env:
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: 'master'
#
# Dependencies
#
- 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 ${env:OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
- name: Install build dependencies
run: |
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip -MaximumRetryCount 10
Expand-Archive -Force ninja-win.zip
# Add it to the GitHub Path so it would be available in the subsequent steps
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}/ninja-win"
#
# 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-windows
restore-keys: |
ccache-windows
- name: Configure Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: CMake configure - OpenVINO
run: |
cmake -G "${{ env.CMAKE_GENERATOR }}" `
-DENABLE_CPPLINT=OFF `
-DBUILD_nvidia_plugin=OFF `
-DBUILD_SHARED_LIBS=ON `
-DENABLE_TESTS=OFF `
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF `
-DENABLE_STRICT_DEPENDENCIES=OFF `
-DENABLE_PYTHON=ON `
-DENABLE_JS=OFF `
-DENABLE_SAMPLES=OFF `
-DENABLE_OV_ONNX_FRONTEND=OFF `
-DENABLE_OV_PADDLE_FRONTEND=OFF `
-DENABLE_OV_PYTORCH_FRONTEND=OFF `
-DENABLE_OV_TF_FRONTEND=OFF `
-DENABLE_OV_TF_LITE_FRONTEND=OFF `
-DENABLE_INTEL_GPU=OFF `
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `
-S ${{ env.OPENVINO_REPO }} `
-B ${{ env.BUILD_DIR }}
- name: Clean ccache stats
run: ccache --zero-stats --show-config
- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
- name: Show ccache stats
run: ccache --show-stats
- name: Cmake install - OpenVINO
run: |
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCOMPONENT=python_wheels -P ${{ env.BUILD_DIR }}/cmake_install.cmake
- name: Pack Artifacts
run: |
$file=Get-ChildItem -Path "${{ env.INSTALL_DIR }}"
$compress = @{
Path = $file
CompressionLevel = "Optimal"
DestinationPath = "${{ env.BUILD_DIR }}/openvino_package.zip"
}
Compress-Archive @compress
#
# 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.zip
if-no-files-found: 'error'
openvino_tokenizers:
name: OpenVINO tokenizers extension
needs: [ openvino_build ]
timeout-minutes: 25
defaults:
run:
shell: pwsh
runs-on: windows-latest
env:
OPENVINO_REPO: ${{ github.workspace }}\\openvino
INSTALL_DIR: ${{ github.workspace }}\\openvino\\install
OPENVINO_TOKENIZERS_REPO: ${{ github.workspace }}\\openvino_tokenizers
BUILD_DIR: ${{ github.workspace }}\\openvino_tokenizers\\build
steps:
- name: Clone Openvino tokenizers
uses: actions/checkout@v4
with:
path: ${{ env.OPENVINO_TOKENIZERS_REPO }}
- name: Clone Openvino
uses: actions/checkout@v4
with:
repository: 'openvinotoolkit/openvino'
path: ${{ env.OPENVINO_REPO }}
ref: 'master'
sparse-checkout: |
install_build_dependencies.sh
- 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.INSTALL_DIR }}
- name: Extract OpenVINO packages
run: |
pushd ${{ env.INSTALL_DIR }}
Expand-Archive openvino_package.zip -DestinationPath "${{ env.INSTALL_DIR }}"
popd
#
# Dependencies
#
- name: Install python dependencies
run: |
# wheel packaging
python3 -m pip install -r ${env:OPENVINO_TOKENIZERS_REPO}/requirements-build.txt
#
# Build
#
- name: Build tokenizers wheel
run: |
. "${{ env.INSTALL_DIR }}/setupvars.ps1"
python3 -m build --wheel --outdir ${env:BUILD_DIR} ${env:OPENVINO_TOKENIZERS_REPO}
env:
CMAKE_ARGS: '-DBUILD_FAST_TOKENIZERS=OFF'
CMAKE_BUILD_PARALLEL_LEVEL: '4'
SKBUILD_WHEEL_BUILD_TAG: ${{ github.run_id }}
#
# Upload build artifacts
#
- name: Upload openvino tokenizers wheel
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: openvino_tokenizers_wheel
path: ${{ env.BUILD_DIR }}/*.whl
if-no-files-found: 'error'
openvino_tokenizers_tests:
name: OpenVINO tokenizers tests
needs: [ openvino_tokenizers ]
timeout-minutes: 25
defaults:
run:
shell: pwsh
runs-on: windows-latest
env:
OPENVINO_REPO: ${{ github.workspace }}\\openvino
INSTALL_DIR: ${{ github.workspace }}\\openvino\\install
OPENVINO_TOKENIZERS_REPO: ${{ github.workspace }}\\openvino_tokenizers
BUILD_DIR: ${{ github.workspace }}\\openvino_tokenizers\\build
steps:
- name: Clone Openvino tokenizers sources and tests
uses: actions/checkout@v4
with:
path: ${{ env.OPENVINO_TOKENIZERS_REPO }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Download tokenizers package
uses: actions/download-artifact@v4
with:
name: openvino_tokenizers_wheel
path: ${{ env.INSTALL_DIR }}\\ov_tokenizers
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
name: openvino_package
path: ${{ env.INSTALL_DIR }}
- name: Extract OpenVINO packages
run: |
pushd ${{ env.INSTALL_DIR }}
Expand-Archive openvino_package.zip -DestinationPath "${{ env.INSTALL_DIR }}"
popd
- name: Install OpenVINO Python wheel
run: |
# Find and install wheel
$ovCoreWheelPath=Get-ChildItem -Path "${{ env.INSTALL_DIR }}\\tools" -Filter openvino-*.whl | % { $_.FullName }
python3 -m pip install "$ovCoreWheelPath"
- name: Install OpenVINO tokenizers wheel
run: |
# Find and install wheel
$ovCoreWheelPath=Get-ChildItem -Path "${{ env.INSTALL_DIR }}\\ov_tokenizers" -Filter openvino_tokenizers*.whl | % { $_.FullName }
python3 -m pip install "$ovCoreWheelPath[all]"
- name: Tokenizers regression tests
run: |
python3 -m pytest -n logical tokenizers_test.py
working-directory: ${{ env.OPENVINO_TOKENIZERS_REPO }}/tests