Skip to content

Commit d0dd121

Browse files
[CI] Clean GPU builds up
Use it actually as reusable workflow - enable limited scope in PR/push and full scope in Nightly workflow. Now, each provider have its own, separate job in PR/push.
1 parent ca182ec commit d0dd121

File tree

3 files changed

+61
-126
lines changed

3 files changed

+61
-126
lines changed

.github/workflows/nightly.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,14 @@ jobs:
175175
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
176176
call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat"
177177
ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
178+
179+
L0:
180+
uses: ./.github/workflows/reusable_gpu.yml
181+
with:
182+
name: "LEVEL_ZERO"
183+
os: "['Ubuntu', 'Windows']"
184+
CUDA:
185+
uses: ./.github/workflows/reusable_gpu.yml
186+
with:
187+
name: "CUDA"
188+
os: "['Ubuntu']"

.github/workflows/pr_push.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ jobs:
3434
MultiNuma:
3535
needs: [FastBuild]
3636
uses: ./.github/workflows/reusable_multi_numa.yml
37+
L0:
38+
needs: [Build]
39+
uses: ./.github/workflows/reusable_gpu.yml
40+
with:
41+
name: "LEVEL_ZERO"
42+
os: "['Ubuntu', 'Windows']"
43+
shared_lib: "['ON']"
44+
CUDA:
45+
needs: [Build]
46+
uses: ./.github/workflows/reusable_gpu.yml
47+
with:
48+
name: "CUDA"
49+
os: "['Ubuntu']"
50+
shared_lib: "['ON']"
3751
Sanitizers:
3852
needs: [FastBuild]
3953
uses: ./.github/workflows/reusable_sanitizers.yml
@@ -46,16 +60,13 @@ jobs:
4660
ProxyLib:
4761
needs: [Build]
4862
uses: ./.github/workflows/reusable_proxy_lib.yml
49-
GPU:
50-
needs: [Build]
51-
uses: ./.github/workflows/reusable_gpu.yml
5263
Valgrind:
5364
needs: [Build]
5465
uses: ./.github/workflows/reusable_valgrind.yml
5566
Coverage:
5667
# total coverage (on upstream only)
5768
if: github.repository == 'oneapi-src/unified-memory-framework'
58-
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
69+
needs: [Build, DevDax, L0, CUDA, MultiNuma, Qemu, ProxyLib]
5970
uses: ./.github/workflows/reusable_coverage.yml
6071
secrets: inherit
6172
with:

.github/workflows/reusable_gpu.yml

Lines changed: 35 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,25 @@
44

55
name: GPU
66

7-
on: [workflow_call]
7+
on:
8+
workflow_call:
9+
inputs:
10+
name:
11+
description: Provider name
12+
type: string
13+
required: true
14+
os:
15+
description: A list of OSes
16+
type: string
17+
required: true
18+
build_type:
19+
description: A list of build types
20+
type: string
21+
default: "['Debug', 'Release']"
22+
shared_lib:
23+
description: A list of options for building shared library
24+
type: string
25+
default: "['ON', 'OFF']"
826

927
permissions:
1028
contents: read
@@ -15,30 +33,28 @@ env:
1533
COVERAGE_DIR : "${{github.workspace}}/coverage"
1634

1735
jobs:
18-
gpu-Level-Zero:
19-
name: Level-Zero
36+
gpu:
37+
name: "${{inputs.name}}: ${{matrix.os}}, ${{matrix.build_type}}, shared=${{matrix.shared_library}}"
2038
env:
2139
VCPKG_PATH: "${{github.workspace}}/../../../../vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/tbb_x64-windows;${{github.workspace}}/../../../../vcpkg/packages/jemalloc_x64-windows"
22-
COVERAGE_NAME : "exports-coverage-gpu"
40+
COVERAGE_NAME : "exports-coverage-${{inputs.name}}"
2341
# run only on upstream; forks will not have the HW
2442
if: github.repository == 'oneapi-src/unified-memory-framework'
2543
strategy:
44+
fail-fast: false
2645
matrix:
27-
shared_library: ['ON', 'OFF']
28-
os: ['Ubuntu', 'Windows']
29-
build_type: ['Debug', 'Release']
46+
shared_library: ${{ fromJSON(inputs.shared_lib)}}
47+
os: ${{ fromJSON(inputs.os)}}
48+
build_type: ${{ fromJSON(inputs.build_type)}}
3049
include:
3150
- os: 'Ubuntu'
3251
compiler: {c: gcc, cxx: g++}
3352
number_of_processors: '$(nproc)'
3453
- os: 'Windows'
3554
compiler: {c: cl, cxx: cl}
3655
number_of_processors: '$Env:NUMBER_OF_PROCESSORS'
37-
exclude:
38-
- os: 'Windows'
39-
build_type: 'Debug'
4056

41-
runs-on: ["DSS-LEVEL_ZERO", "DSS-${{matrix.os}}"]
57+
runs-on: ["DSS-${{inputs.name}}", "DSS-${{matrix.os}}"]
4258
steps:
4359
- name: Checkout
4460
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -49,8 +65,8 @@ jobs:
4965
if: matrix.os == 'Ubuntu'
5066
run: .github/scripts/get_system_info.sh
5167

52-
- name: Configure build for Win
53-
if: matrix.os == 'Windows'
68+
# note: disable all providers except the one being tested
69+
- name: Configure build
5470
run: >
5571
cmake
5672
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
@@ -64,36 +80,14 @@ jobs:
6480
-DUMF_BUILD_TESTS=ON
6581
-DUMF_BUILD_GPU_TESTS=ON
6682
-DUMF_BUILD_GPU_EXAMPLES=ON
67-
-DUMF_FORMAT_CODE_STYLE=OFF
68-
-DUMF_DEVELOPER_MODE=ON
69-
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
70-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
71-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
72-
-DUMF_BUILD_CUDA_PROVIDER=OFF
73-
-DUMF_TESTS_FAIL_ON_SKIP=ON
74-
75-
- name: Configure build for Ubuntu
76-
if: matrix.os == 'Ubuntu'
77-
run: >
78-
cmake
79-
-B ${{env.BUILD_DIR}}
80-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
81-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
82-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
83-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
84-
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
85-
-DUMF_BUILD_BENCHMARKS=ON
86-
-DUMF_BUILD_TESTS=ON
87-
-DUMF_BUILD_GPU_TESTS=ON
88-
-DUMF_BUILD_GPU_EXAMPLES=ON
89-
-DUMF_FORMAT_CODE_STYLE=OFF
9083
-DUMF_DEVELOPER_MODE=ON
9184
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
9285
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
93-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
9486
-DUMF_BUILD_CUDA_PROVIDER=OFF
87+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
88+
-DUMF_BUILD_${{inputs.name}}_PROVIDER=ON
9589
-DUMF_TESTS_FAIL_ON_SKIP=ON
96-
${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
90+
${{ matrix.os == 'Ubuntu' && matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
9791
9892
- name: Build UMF
9993
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
@@ -111,7 +105,7 @@ jobs:
111105
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
112106

113107
- name: Check coverage
114-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
108+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
115109
working-directory: ${{env.BUILD_DIR}}
116110
run: |
117111
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
@@ -121,88 +115,7 @@ jobs:
121115
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
122116
123117
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
124-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
118+
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
125119
with:
126-
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
120+
name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-${{matrix.build_type}}-shared-${{matrix.shared_library}}
127121
path: ${{env.COVERAGE_DIR}}
128-
129-
gpu-CUDA:
130-
name: CUDA
131-
env:
132-
COVERAGE_NAME : "exports-coverage-gpu-CUDA"
133-
# run only on upstream; forks will not have the HW
134-
if: github.repository == 'oneapi-src/unified-memory-framework'
135-
strategy:
136-
matrix:
137-
shared_library: ['ON', 'OFF']
138-
build_type: ['Debug', 'Release']
139-
# TODO add windows
140-
os: ['Ubuntu']
141-
include:
142-
- os: 'Ubuntu'
143-
compiler: {c: gcc, cxx: g++}
144-
number_of_processors: '$(nproc)'
145-
146-
runs-on: ["DSS-CUDA", "DSS-${{matrix.os}}"]
147-
steps:
148-
- name: Checkout
149-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
150-
with:
151-
fetch-depth: 0
152-
153-
- name: Get information about platform
154-
if: matrix.os == 'Ubuntu'
155-
run: .github/scripts/get_system_info.sh
156-
157-
- name: Configure build for Ubuntu
158-
if: matrix.os == 'Ubuntu'
159-
run: >
160-
cmake -B ${{env.BUILD_DIR}}
161-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
162-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
163-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
164-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
165-
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
166-
-DUMF_BUILD_BENCHMARKS=ON
167-
-DUMF_BUILD_TESTS=ON
168-
-DUMF_BUILD_GPU_TESTS=ON
169-
-DUMF_BUILD_GPU_EXAMPLES=ON
170-
-DUMF_FORMAT_CODE_STYLE=OFF
171-
-DUMF_DEVELOPER_MODE=ON
172-
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
173-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
174-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
175-
-DUMF_BUILD_CUDA_PROVIDER=ON
176-
-DUMF_TESTS_FAIL_ON_SKIP=ON
177-
${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
178-
179-
- name: Build UMF
180-
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors}}
181-
182-
- name: Run tests
183-
working-directory: ${{env.BUILD_DIR}}
184-
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
185-
186-
- name: Run examples
187-
working-directory: ${{env.BUILD_DIR}}
188-
run: ctest --output-on-failure --test-dir examples -C ${{matrix.build_type}}
189-
190-
- name: Run benchmarks
191-
working-directory: ${{env.BUILD_DIR}}
192-
run: ctest --output-on-failure --test-dir benchmark -C ${{matrix.build_type}} --exclude-regex umf-bench-multithreaded
193-
194-
- name: Check coverage
195-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
196-
working-directory: ${{env.BUILD_DIR}}
197-
run: |
198-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
199-
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
200-
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
201-
mkdir -p ${{env.COVERAGE_DIR}}
202-
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
203-
204-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
205-
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'Ubuntu' }}
206-
with:
207-
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
208-
path: ${{env.COVERAGE_DIR}}

0 commit comments

Comments
 (0)