-
Notifications
You must be signed in to change notification settings - Fork 47
426 lines (381 loc) · 17.8 KB
/
Copy pathreusable_compatibility.yml
File metadata and controls
426 lines (381 loc) · 17.8 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
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
419
420
421
422
423
424
425
426
# Workflow for checking the backward compatibility of UMF.
# Test the latest UMF shared library with binaries compiled using the older UMF
# shared library.
name: Compatibility
on:
workflow_call:
inputs:
tag:
description: Check backward compatibility with this tag
type: string
# While we're still compatible with v1.0.0, we implemented a fix in v1.0.1
# to verify if the split operation is supported (in jemalloc pool).
# Without bumping the tag we'd have to omit some tests.
default: "v1.0.1"
permissions:
contents: read
jobs:
ubuntu:
name: Ubuntu
runs-on: 'ubuntu-22.04'
steps:
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y clang cmake hwloc libhwloc-dev libnuma-dev libtbb-dev
- name: Checkout "tag" UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: refs/tags/${{inputs.tag}}
path: ${{github.workspace}}/tag_version
- name: Checkout latest UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
path: ${{github.workspace}}/latest_version
- name: Configure latest UMF build
working-directory: ${{github.workspace}}/latest_version
run: >
cmake
-B ${{github.workspace}}/latest_version/build
-DCMAKE_INSTALL_PREFIX=_install
-DCMAKE_BUILD_TYPE=Debug
-DUMF_BUILD_SHARED_LIBRARY=ON
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DUMF_BUILD_TESTS=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
- name: Build latest UMF
working-directory: ${{github.workspace}}/latest_version
run: |
cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
- name: Install latest UMF
working-directory: ${{github.workspace}}/latest_version
run: sudo cmake --install ${{github.workspace}}/latest_version/build --config Debug
- name: Configure "tag" UMF build
working-directory: ${{github.workspace}}/tag_version
run: >
cmake
-B ${{github.workspace}}/tag_version/build
-DCMAKE_BUILD_TYPE=Debug
-DUMF_BUILD_SHARED_LIBRARY=ON
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_EXAMPLES=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
- name: Build "tag" UMF
working-directory: ${{github.workspace}}/tag_version
run: |
cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
- name: Run "tag" UMF tests
working-directory: ${{github.workspace}}/tag_version/build
run: |
LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
run: |
ctest --verbose -E "test_memoryProvider|test_disjoint_pool"
- name: Run disabled tests individually with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
run: |
test/test_memoryProvider --gtest_filter="-*Trace"
test/test_disjoint_pool --gtest_filter="-test.internals"
# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
- name: Build and run "tag" examples using the latest UMF libraries
working-directory: ${{github.workspace}}/tag_version
run: |
EXAMPLES_EXCLUDE_LIST="cmake|common|hmat|level_zero|cuda"
rm -rf build
rm -rf include
mkdir _examples
cd _examples
EXAMPLES_LIST=$(find ${{github.workspace}}/tag_version/examples -maxdepth 1 -mindepth 1 -type d | grep -Ev $EXAMPLES_EXCLUDE_LIST | xargs -n 1 basename)
for EXAMPLE_NAME in $EXAMPLES_LIST; do
cd ${{github.workspace}}/tag_version
mkdir -p _examples/$EXAMPLE_NAME;
cd _examples/$EXAMPLE_NAME;
echo "Building example: $EXAMPLE_NAME"
CMAKE_PREFIX_PATH=${{github.workspace}}/latest_version/_install cmake ${{github.workspace}}/tag_version/examples/$EXAMPLE_NAME;
make;
find . -maxdepth 1 -type f -executable -exec echo "Running example: {}" \; -exec {} \;
done
windows:
name: Windows
env:
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
VCPKG_BIN_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows/bin;${{github.workspace}}/vcpkg/packages/tbb_x64-windows/bin;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows/bin"
runs-on: "windows-latest"
steps:
- name: Checkout "tag" UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: refs/tags/${{inputs.tag}}
path: ${{github.workspace}}/tag_version
- name: Restore vcpkg cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache
with:
path: vcpkg_pkgs_cache.zip
key: vcpkg-compat-windows-latest-${{ hashFiles('tag_version/vcpkg.json') }}
- name: Unpack vcpkg cache
if: steps.cache.outputs.cache-hit == 'true'
run: |
Expand-Archive -Path ${{github.workspace}}/vcpkg_pkgs_cache.zip -DestinationPath ${{github.workspace}}/vcpkg -Force
- name: Initialize vcpkg
if: steps.cache.outputs.cache-hit != 'true'
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{github.workspace}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'
# NOTE we use vcpkg setup from "tag" version
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/tag_version
env:
VCPKG_BINARY_SOURCES: clear
run: vcpkg install --triplet x64-windows
- name: Checkout latest UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
path: ${{github.workspace}}/latest_version
- name: Configure latest UMF build
working-directory: ${{github.workspace}}/latest_version
run: >
cmake
-B "${{github.workspace}}/latest_version/build"
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_INSTALL_PREFIX=_install
-DCMAKE_C_COMPILER=cl
-DCMAKE_CXX_COMPILER=cl
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_BUILD_TESTS=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
- name: Build latest UMF
run: cmake --build "${{github.workspace}}/latest_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
- name: Install latest UMF
working-directory: ${{github.workspace}}/latest_version
run: cmake --install ${{github.workspace}}/latest_version/build --config Debug
- name: Configure "tag" UMF build
working-directory: ${{github.workspace}}/tag_version
run: >
cmake
-B "${{github.workspace}}/tag_version/build"
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=cl
-DCMAKE_CXX_COMPILER=cl
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_EXAMPLES=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
-DUMF_BUILD_CUDA_PROVIDER=ON
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
- name: Build "tag" UMF
run: cmake --build "${{github.workspace}}/tag_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
- name: Run "tag" UMF tests
working-directory: "${{github.workspace}}/tag_version/build"
run: ctest -C Debug --output-on-failure --test-dir test
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
run: |
$env:UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
cp ${{github.workspace}}/latest_version/build/bin/Debug/umf.dll ${{github.workspace}}/tag_version/build/bin/Debug/umf.dll
ctest -C Debug --verbose -E "test_memoryProvider|test_disjoint_pool"
$env:Path = "${{github.workspace}}/tag_version/build/bin/Debug;${{env.VCPKG_BIN_PATH}};$env:Path"
test/Debug/test_memoryProvider.exe --gtest_filter="-*Trace"
test/Debug/test_disjoint_pool.exe --gtest_filter="-test.internals"
# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
- name: Build and run "tag" examples using the latest UMF libraries
working-directory: ${{github.workspace}}/tag_version
run: |
$ErrorActionPreference = "Stop"
$EXAMPLES_EXCLUDE_LIST = "cmake|common|hmat|level_zero|cuda|custom|ipc|numa"
Set-Location "${{github.workspace}}/tag_version"
Remove-Item -Recurse -ErrorAction Ignore -Force build, include
New-Item -ItemType Directory -Path _examples
Set-Location -Path _examples
$EXAMPLES_LIST = Get-ChildItem -Path "${{github.workspace}}/tag_version/examples" -Directory | Where-Object { $_.Name -notmatch $EXAMPLES_EXCLUDE_LIST } | ForEach-Object { $_.Name }
# NOTE: we add our paths at the beginning of the PATH variable because
# there is a limit on the size of the PATH variable in Windows
$env:Path = "${{github.workspace}}/latest_version/_install/bin;${{env.VCPKG_BIN_PATH}};$env:Path"
foreach ($EXAMPLE_NAME in $EXAMPLES_LIST) {
Set-Location -Path "${{github.workspace}}/tag_version"
New-Item -ItemType Directory -Path "_examples/$EXAMPLE_NAME"
Set-Location -Path "_examples/$EXAMPLE_NAME"
Write-Output "`nBuilding example: $EXAMPLE_NAME"
cmake -DCMAKE_PREFIX_PATH="${{github.workspace}}/latest_version/_install;${{env.VCPKG_PATH}}" "${{github.workspace}}/tag_version/examples/$EXAMPLE_NAME"
cmake --build .
Set-Location -Path Debug
Write-Output "`nRunning example: $EXAMPLE_NAME"
$exeFiles = Get-ChildItem -Filter *.exe
if ($exeFiles.Count -eq 0) {
Write-Error "No executable files found in the current directory."
exit 1
}
foreach ($exeFile in $exeFiles) {
Write-Output "Running: $($exeFile.FullName)"
& $exeFile.FullName
if ($LASTEXITCODE -ne 0) {
$unsignedExitCode = [Convert]::ToInt32($LASTEXITCODE)
# Format the error code as a hexadecimal string
$hexErrorCode = [Convert]::ToString($unsignedExitCode, 16).ToUpper()
Write-Output "error 0x$hexErrorCode"
exit $LASTEXITCODE
}
}
}
- name: Prepare vcpkg cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
Compress-Archive -Path ${{github.workspace}}/vcpkg/packages -DestinationPath ${{github.workspace}}/vcpkg_pkgs_cache.zip -Force -CompressionLevel Fastest
- name: Save vcpkg cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{github.workspace}}/vcpkg_pkgs_cache.zip
key: ${{ steps.cache.outputs.cache-primary-key }}
gpu:
name: GPU Ubuntu
# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'
strategy:
matrix:
provider: ['LEVEL_ZERO', 'CUDA']
runs-on: ["DSS-${{matrix.provider}}", "DSS-UBUNTU"]
steps:
- name: Checkout latest UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
path: ${{github.workspace}}/latest_version
- name: Configure latest UMF build
working-directory: ${{github.workspace}}/latest_version
run: >
cmake
-B ${{github.workspace}}/latest_version/build
-DCMAKE_INSTALL_PREFIX=_install
-DCMAKE_BUILD_TYPE=Debug
-DUMF_BUILD_SHARED_LIBRARY=ON
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DUMF_BUILD_TESTS=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.provider == 'LEVEL_ZERO' && 'ON' || 'OFF' }}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.provider == 'CUDA' && 'ON' || 'OFF' }}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
- name: Build latest UMF
working-directory: ${{github.workspace}}/latest_version
run: |
cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
- name: Install latest UMF
working-directory: ${{github.workspace}}/latest_version
run: cmake --install ${{github.workspace}}/latest_version/build --config Debug
- name: Checkout "tag" UMF version
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: refs/tags/${{inputs.tag}}
path: ${{github.workspace}}/tag_version
- name: Configure "tag" UMF build
working-directory: ${{github.workspace}}/tag_version
run: >
cmake
-B ${{github.workspace}}/tag_version/build
-DCMAKE_BUILD_TYPE=Debug
-DUMF_BUILD_SHARED_LIBRARY=ON
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_EXAMPLES=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=${{matrix.provider == 'LEVEL_ZERO' && 'ON' || 'OFF' }}
-DUMF_BUILD_CUDA_PROVIDER=${{matrix.provider == 'CUDA' && 'ON' || 'OFF' }}
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
- name: Build "tag" UMF
working-directory: ${{github.workspace}}/tag_version
run: |
cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
- name: Run "tag" UMF tests
working-directory: ${{github.workspace}}/tag_version/build
run: >
LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/
ctest --output-on-failure
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
run: |
ctest --verbose -E "test_memoryProvider|test_disjoint_pool|test_provider_level_zero|test_provider_level_zero_dlopen_global|test_provider_level_zero_dlopen_local"
- name: Run disabled tests individually with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
MATRIX_PROVIDER: ${{matrix.provider}}
run: |
test/test_memoryProvider --gtest_filter="-*Trace"
test/test_disjoint_pool --gtest_filter="-test.internals"
if [[ "$MATRIX_PROVIDER" == "LEVEL_ZERO" ]]; then
test/test_provider_level_zero --gtest_filter="-*allocInvalidSize/2"
test/test_provider_level_zero_dlopen_global --gtest_filter="-*allocInvalidSize/2"
test/test_provider_level_zero_dlopen_local --gtest_filter="-*allocInvalidSize/2"
fi
# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
# NOTE: exclude either CUDA or Level Zero examples depending on the GPU
- name: Build and run "tag" examples using the latest UMF libraries
working-directory: ${{github.workspace}}/tag_version
run: |
EXAMPLES_EXCLUDE_LIST="cmake|common|hmat|${{matrix.provider == 'LEVEL_ZERO' && 'cuda' || 'level_zero' }}"
rm -rf build
rm -rf include
mkdir _examples
cd _examples
EXAMPLES_LIST=$(find ${{github.workspace}}/tag_version/examples -maxdepth 1 -mindepth 1 -type d | grep -Ev $EXAMPLES_EXCLUDE_LIST | xargs -n 1 basename)
for EXAMPLE_NAME in $EXAMPLES_LIST; do
cd ${{github.workspace}}/tag_version
mkdir -p _examples/$EXAMPLE_NAME;
cd _examples/$EXAMPLE_NAME;
echo "Building example: $EXAMPLE_NAME"
CMAKE_PREFIX_PATH=${{github.workspace}}/latest_version/_install cmake ${{github.workspace}}/tag_version/examples/$EXAMPLE_NAME;
find . -maxdepth 1 -type f -executable -exec echo "Running example: {}" \; -exec {} \;
done
# TODO add GPU windows