-
Notifications
You must be signed in to change notification settings - Fork 47
211 lines (185 loc) · 8.46 KB
/
Copy pathreusable_gpu.yml
File metadata and controls
211 lines (185 loc) · 8.46 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
# This workflow builds and tests providers using GPU memory. It requires properly
# labelled self-hosted runners on systems with the correct GPU and drivers.
name: GPU
on:
workflow_call:
inputs:
provider:
description: Provider name
type: string
required: true
runner:
description: Runner name (without 'DSS-' prefix)
type: string
required: true
os:
description: A list of OSes
type: string
default: "['Ubuntu', 'Windows']"
shared_lib:
description: A list of options for building shared library
type: string
default: "['ON', 'OFF']"
permissions:
contents: read
env:
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
jobs:
gpu:
env:
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows;"
COVERAGE_NAME : "exports-coverage-${{inputs.provider}}-${{inputs.runner}}"
# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'
strategy:
fail-fast: false
matrix:
shared_library: ${{ fromJSON(inputs.shared_lib)}}
os: ${{ fromJSON(inputs.os)}}
name: GPU (${{matrix.os}}, shared=${{matrix.shared_library}})
runs-on: ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]
steps:
# Set various build params based on OS
- name: "[Win] Establish build params"
if : ${{ matrix.os == 'Windows' }}
run: |
echo "C_COMPILER=cl" >> $env:GITHUB_ENV
echo "CXX_COMPILER=cl" >> $env:GITHUB_ENV
echo "PROCS=$Env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV
echo "EXTRA_CMAKE_PATH=$Env:CUDA_PATH" >> $env:GITHUB_ENV
- name: "[Lin] Establish build params"
if : ${{ matrix.os == 'Ubuntu' }}
run: |
echo "C_COMPILER=gcc" >> $GITHUB_ENV
echo "CXX_COMPILER=g++" >> $GITHUB_ENV
echo "PROCS=$(nproc)" >> $GITHUB_ENV
- name: "[Lin] Clean workspace"
if: matrix.os == 'Ubuntu'
run: |
find $GITHUB_WORKSPACE -mindepth 1 -delete 2>/dev/null || true
mkdir -p $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: "[Lin] Get information about platform"
if: matrix.os == 'Ubuntu'
run: .github/scripts/get_system_info.sh
- name: "[Win] Restore vcpkg cache"
if: matrix.os == 'Windows'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache
with:
path: vcpkg_pkgs_cache.zip
key: vcpkg-gpu-${{inputs.runner}}-windows-${{ hashFiles('vcpkg.json') }}
- name: "[Win] Unpack vcpkg cache"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit == 'true'
run: |
Expand-Archive -Path ${{github.workspace}}/vcpkg_pkgs_cache.zip -DestinationPath ${{github.workspace}}/vcpkg -Force
- name: "[Win] Initialize vcpkg"
if: matrix.os == 'Windows' && 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'
- name: "[Win] Install dependencies"
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
env:
VCPKG_BINARY_SOURCES: clear
run: vcpkg install --triplet x64-windows
# note: disable all providers except the one being tested
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
- name: Configure build (Debug)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_DEBUG_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Ubuntu' && '-DUMF_USE_COVERAGE=ON' || '' }}
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
- name: Build UMF (Debug)
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}
- name: Run tests (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest -C Debug --output-on-failure --test-dir test
- name: Run examples (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest --output-on-failure --test-dir examples -C Debug
- name: Configure build (Release)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_RELEASE_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
- name: Build UMF (Release)
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}
- name: Run tests (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest -C Release --output-on-failure --test-dir test
- name: Run examples (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir examples -C Release
- name: Run benchmarks (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded
- name: "[Lin] Check coverage (Debug)"
if: ${{ matrix.os == 'Ubuntu' }}
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
mkdir -p ${{env.COVERAGE_DIR}}
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
- name: "[Lin] Upload coverage"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ matrix.os == 'Ubuntu' }}
with:
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}
- name: "[Win] Prepare vcpkg cache"
if: matrix.os == 'Windows' && 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: "[Win] Save vcpkg cache"
if: matrix.os == 'Windows' && 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 }}