Skip to content

Commit cdda8c2

Browse files
committed
[GHA] Separate out hardware workflows
The goal of this patch is two fold: 1. Reduce the number of jobs currently in the `cmake.yml` workflow, viewing this workflow in the GitHub web UI can get quite unruly. 2. Separate the workflows which test on hardware such that if a single adapter fails to build or pass tests if will not cancel testing of other adapters. It aims to do this by moving the hardware jobs out of the `cmake.yml` workflow into the new `build-hw-reusable.yml` workflow, which as the name suggests is reusable. This reusable workflow is then used by five new adapter specific workflows.
1 parent 717791b commit cdda8c2

File tree

4 files changed

+181
-122
lines changed

4 files changed

+181
-122
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[*]
22
indent_style = space
33
indent_size = 4
4+
5+
[.github/workflows/*.yml]
6+
indent_size = 2
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: Build - Adapters on HW - Reusable
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
name:
8+
required: true
9+
type: string
10+
platform:
11+
required: false
12+
type: string
13+
default: ""
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
adapter-build-hw:
20+
name: Build & Test HW
21+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
22+
strategy:
23+
matrix:
24+
adapter: [
25+
{name: "${{inputs.name}}", platform: "${{inputs.platform}}"},
26+
]
27+
build_type: [Debug, Release]
28+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
29+
# TODO: The latest L0 loader segfaults when built with clang.
30+
exclude:
31+
- adapter: {name: L0, platform: ""}
32+
compiler: {c: clang, cxx: clang++}
33+
34+
runs-on: ${{matrix.adapter.name}}
35+
36+
steps:
37+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
39+
- name: Install pip packages
40+
run: pip install -r third_party/requirements.txt
41+
42+
- name: Download DPC++
43+
run: |
44+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
45+
mkdir dpcpp_compiler
46+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
47+
48+
- name: Configure CMake
49+
run: >
50+
cmake
51+
-B${{github.workspace}}/build
52+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
53+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
54+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
55+
-DUR_ENABLE_TRACING=ON
56+
-DUR_DEVELOPER_MODE=ON
57+
-DUR_BUILD_TESTS=ON
58+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
59+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
60+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
61+
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
62+
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
63+
64+
- name: Build
65+
# This is so that device binaries can find the sycl runtime library
66+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
67+
68+
- name: Test adapter specific
69+
working-directory: ${{github.workspace}}/build
70+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
71+
72+
- name: Test adapters
73+
working-directory: ${{github.workspace}}/build
74+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
75+
76+
- name: Get information about platform
77+
if: ${{ always() }}
78+
run: .github/scripts/get_system_info.sh

.github/workflows/cmake.yml

Lines changed: 31 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Generate source from spec, check for uncommitted diff
105105
if: matrix.os == 'ubuntu-22.04'
106106
run: cmake --build ${{github.workspace}}/build --target check-generated
107-
107+
108108
- name: Verify that each source file contains a license
109109
run: cmake --build ${{github.workspace}}/build --target verify-licenses
110110

@@ -160,127 +160,36 @@ jobs:
160160
working-directory: ${{github.workspace}}/build
161161
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose
162162

163-
adapter-build-hw:
164-
name: Build - Adapters on HW
165-
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
166-
strategy:
167-
matrix:
168-
adapter: [
169-
{name: CUDA, platform: ""},
170-
{name: HIP, platform: ""},
171-
{name: L0, platform: ""},
172-
{name: OPENCL, platform: "Intel(R) OpenCL"},
173-
{name: NATIVE_CPU, platform: ""}
174-
]
175-
build_type: [Debug, Release]
176-
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
177-
# TODO: The latest L0 loader segfaults when built with clang.
178-
exclude:
179-
- adapter: {name: L0, platform: ""}
180-
compiler: {c: clang, cxx: clang++}
181-
182-
runs-on: ${{matrix.adapter.name}}
183-
184-
steps:
185-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
186-
187-
- name: Install pip packages
188-
run: pip install -r third_party/requirements.txt
189-
190-
- name: Download DPC++
191-
run: |
192-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
193-
mkdir dpcpp_compiler
194-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
195-
196-
- name: Configure CMake
197-
run: >
198-
cmake
199-
-B${{github.workspace}}/build
200-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
201-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
202-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
203-
-DUR_ENABLE_TRACING=ON
204-
-DUR_DEVELOPER_MODE=ON
205-
-DUR_BUILD_TESTS=ON
206-
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
207-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
208-
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
209-
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
210-
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
211-
212-
- name: Build
213-
# This is so that device binaries can find the sycl runtime library
214-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
215-
216-
- name: Test adapter specific
217-
working-directory: ${{github.workspace}}/build
218-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
219-
220-
- name: Test adapters
221-
working-directory: ${{github.workspace}}/build
222-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
223-
224-
- name: Get information about platform
225-
if: ${{ always() }}
226-
run: .github/scripts/get_system_info.sh
227-
228-
examples-build-hw:
229-
name: Build - examples on HW
230-
# if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
231-
if: false # temporaily disabled due to conda env setup issues
232-
strategy:
233-
matrix:
234-
adapter: [
235-
{name: L0}
236-
]
237-
build_type: [Debug, Release]
238-
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
239-
240-
runs-on: ${{matrix.adapter.name}}
241-
242-
steps:
243-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
244-
245-
- name: Install pip packages
246-
run: pip install -r third_party/requirements.txt
247-
248-
- name: Init conda env
249-
uses: conda-incubator/setup-miniconda@9f54435e0e72c53962ee863144e47a4b094bfd35 # v2.3.0
250-
with:
251-
miniconda-version: "latest"
252-
activate-environment: examples
253-
environment-file: third_party/deps.yml
254-
auto-activate-base: false
255-
256-
- name: Configure CMake
257-
shell: bash -el {0}
258-
run: >
259-
cmake
260-
-B${{github.workspace}}/build
261-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
262-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
263-
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
264-
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
265-
-DUR_BUILD_EXAMPLE_CODEGEN=ON
266-
-DUR_DEVELOPER_MODE=ON
267-
268-
- name: Build
269-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
270-
271-
- name: Test codegen example
272-
working-directory: ${{github.workspace}}/build
273-
run: bin/codegen
274-
275-
# conda init adds content to user's profile making it failing (if conda is gone)
276-
- name: Cleanup after conda init
277-
run: |
278-
cat ${HOME}/.profile || true
279-
rm ${HOME}/.profile || true
280-
281-
- name: Get information about platform
282-
if: ${{ always() }}
283-
run: .github/scripts/get_system_info.sh
163+
level-zero:
164+
if: github.repository == 'oneapi-src/unified-runtime'
165+
uses: ./.github/workflows/build-hw-reusable.yml
166+
with:
167+
name: L0
168+
169+
opencl:
170+
if: github.repository == 'oneapi-src/unified-runtime'
171+
uses: ./.github/workflows/build-hw-reusable.yml
172+
with:
173+
name: OPENCL
174+
platform: "Intel(R) OpenCL"
175+
176+
cuda:
177+
if: github.repository == 'oneapi-src/unified-runtime'
178+
uses: ./.github/workflows/build-hw-reusable.yml
179+
with:
180+
name: CUDA
181+
182+
hip:
183+
if: github.repository == 'oneapi-src/unified-runtime'
184+
uses: ./.github/workflows/build-hw-reusable.yml
185+
with:
186+
name: HIP
187+
188+
native_cpu:
189+
if: github.repository == 'oneapi-src/unified-runtime'
190+
uses: ./.github/workflows/build-hw-reusable.yml
191+
with:
192+
name: NATIVE_CPU
284193

285194
windows-build:
286195
name: Build - Windows
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: Examples - Adapters on Level Zero HW
3+
4+
on: [push, pull_request]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
examples:
15+
name: Examples on HW
16+
# if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
17+
if: false # temporaily disabled due to conda env setup issues
18+
strategy:
19+
matrix:
20+
adapter: [
21+
{name: L0}
22+
]
23+
build_type: [Debug, Release]
24+
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
25+
26+
runs-on: ${{matrix.adapter.name}}
27+
28+
steps:
29+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
30+
31+
- name: Install pip packages
32+
run: pip install -r third_party/requirements.txt
33+
34+
- name: Init conda env
35+
uses: conda-incubator/setup-miniconda@9f54435e0e72c53962ee863144e47a4b094bfd35 # v2.3.0
36+
with:
37+
miniconda-version: "latest"
38+
activate-environment: examples
39+
environment-file: third_party/deps.yml
40+
auto-activate-base: false
41+
42+
- name: Configure CMake
43+
shell: bash -el {0}
44+
run: >
45+
cmake
46+
-B${{github.workspace}}/build
47+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
48+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
49+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
50+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
51+
-DUR_BUILD_EXAMPLE_CODEGEN=ON
52+
-DUR_DEVELOPER_MODE=ON
53+
54+
- name: Build
55+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
56+
57+
- name: Test codegen example
58+
working-directory: ${{github.workspace}}/build
59+
run: bin/codegen
60+
61+
# conda init adds content to user's profile making it failing (if conda is gone)
62+
- name: Cleanup after conda init
63+
run: |
64+
cat ${HOME}/.profile || true
65+
rm ${HOME}/.profile || true
66+
67+
- name: Get information about platform
68+
if: ${{ always() }}
69+
run: .github/scripts/get_system_info.sh

0 commit comments

Comments
 (0)