Skip to content

Commit cbec811

Browse files
[UR][CI] Add first version of UR workflow (#16827)
~~Last commit included just to verify if `test_job` will be executed.~~ With extra dummy changes (now missing in PR) we just didn't skip the `test_job`, e.g. here: https://github.com/intel/llvm/actions/runs/13040807649/job/36382037543
1 parent c52a260 commit cbec811

File tree

4 files changed

+387
-1
lines changed

4 files changed

+387
-1
lines changed

.github/workflows/sycl-detect-changes.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ jobs:
7272
- 'sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp'
7373
- 'sycl/include/sycl/ext/oneapi/experimental/detail/invoke_simd_types.hpp'
7474
- 'sycl/test-e2e/(ESIMD|InvokeSimd)/**'
75+
ur:
76+
- 'unified-runtime/**'
7577
7678
- name: Set output
7779
id: result
@@ -84,7 +86,7 @@ jobs:
8486
return '${{ steps.changes.outputs.changes }}';
8587
}
8688
// Treat everything as changed for huge PRs.
87-
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd"];
89+
return ["llvm", "llvm_spirv", "clang", "sycl_jit", "xptifw", "libclc", "sycl", "ci", "esimd", "ur"];
8890
8991
- run: echo '${{ steps.result.outputs.result }}'
9092

.github/workflows/ur-build-hw.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: UR - Build adapters, test on HW
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
adapter_name:
7+
required: true
8+
type: string
9+
other_adapter_name:
10+
required: false
11+
type: string
12+
default: ""
13+
runner_name:
14+
required: true
15+
type: string
16+
platform:
17+
description: "Platform string, `UR_CTS_ADAPTER_PLATFORM` will be set to this."
18+
required: false
19+
type: string
20+
default: ""
21+
static_loader:
22+
required: false
23+
type: string
24+
default: OFF
25+
static_adapter:
26+
required: false
27+
type: string
28+
default: OFF
29+
workflow_dispatch:
30+
inputs:
31+
adapter_name:
32+
required: true
33+
type: string
34+
other_adapter_name:
35+
required: false
36+
type: string
37+
default: ""
38+
runner_name:
39+
required: true
40+
type: string
41+
platform:
42+
description: "Platform string, `UR_CTS_ADAPTER_PLATFORM` will be set to this."
43+
required: false
44+
type: string
45+
default: ""
46+
static_loader:
47+
required: false
48+
type: string
49+
default: OFF
50+
static_adapter:
51+
required: false
52+
type: string
53+
default: OFF
54+
55+
permissions:
56+
contents: read
57+
58+
env:
59+
UR_LOG_CUDA: "level:error;flush:error"
60+
UR_LOG_HIP: "level:error;flush:error"
61+
UR_LOG_LEVEL_ZERO: "level:error;flush:error"
62+
UR_LOG_NATIVE_CPU: "level:error;flush:error"
63+
UR_LOG_OPENCL: "level:error;flush:error"
64+
65+
jobs:
66+
adapter_build_hw:
67+
name: Build & CTS
68+
# run only on upstream; forks won't have the HW
69+
if: github.repository == 'intel/llvm'
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
adapter: [
74+
{
75+
name: "${{inputs.adapter_name}}",
76+
other_name: "${{inputs.other_adapter_name}}",
77+
platform: "${{inputs.platform}}",
78+
static_Loader: "${{inputs.static_loader}}",
79+
static_adapter: "${{inputs.static_loader}}"
80+
}
81+
]
82+
build_type: [Release]
83+
compiler: [{c: gcc, cxx: g++}]
84+
85+
runs-on: ${{inputs.runner_name}}
86+
87+
steps:
88+
# TODO: If UR is merged into llvm it will require changes:
89+
# - checkout only llvm repo
90+
# - configure UR project from local tree
91+
# - investigate if DUR_CONFORMANCE_AMD_ARCH could be removed
92+
# - find better way to handle platform param (e.g. "Intel(R) OpenCL" -> "opencl")
93+
# - switch to Ninja generator in CMake
94+
#
95+
# Also, the step of downloading DPC++ should be integrated somehow;
96+
# most likely use nightly release.
97+
#
98+
- name: Checkout LLVM
99+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
100+
101+
- name: Checkout UR
102+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
103+
with:
104+
repository: 'oneapi-src/unified-runtime'
105+
path: unified-runtime
106+
ref: main
107+
108+
- name: Install pip packages
109+
working-directory: ${{github.workspace}}/unified-runtime
110+
run: pip install -r third_party/requirements.txt
111+
112+
- name: Download DPC++
113+
run: |
114+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
115+
mkdir dpcpp_compiler
116+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
117+
118+
- name: Configure CMake
119+
working-directory: ${{github.workspace}}/unified-runtime
120+
# ">" is used to avoid adding "\" at the end of each line; this command is quite long
121+
run: >
122+
cmake
123+
-B${{github.workspace}}/build
124+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
125+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
126+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
127+
-DUR_ENABLE_TRACING=ON
128+
-DUR_DEVELOPER_MODE=ON
129+
-DUR_BUILD_TESTS=ON
130+
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
131+
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
132+
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
133+
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
134+
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
135+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
136+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
137+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
138+
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
139+
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
140+
141+
- name: Build
142+
# This is so that device binaries can find the sycl runtime library
143+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
144+
145+
- name: Install
146+
# This is to check that install command does not fail
147+
run: cmake --install ${{github.workspace}}/build
148+
149+
- name: Test adapter specific
150+
run: ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600
151+
# Don't run adapter specific tests when building multiple adapters
152+
if: ${{ matrix.adapter.other_name == '' }}
153+
154+
- name: Test adapters
155+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "conformance" --timeout 600
156+
157+
- name: Get information about platform
158+
if: ${{ always() }}
159+
run: ${{github.workspace}}/unified-runtime/.github/scripts/get_system_info.sh

.github/workflows/ur-precommit.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Unified Runtime Pre Commit
2+
# Note: this is the very first version of UR workflow.
3+
# It was pretty much copy-pasted from UR repository.
4+
# Over time it will be most likely integrated more into existing workflows.
5+
6+
# Note: the trigger is copy-pasted from sycl-linux-precommit.yml - probably to be fine-tuned.
7+
on:
8+
# We rely on "Fork pull request workflows from outside collaborators" -
9+
# "Require approval for all outside collaborators" at
10+
# https://github.com/intel/llvm/settings/actions for security.
11+
pull_request:
12+
branches:
13+
- sycl
14+
- sycl-rel-**
15+
# Do not run builds if changes are only in the following locations
16+
paths-ignore:
17+
- '.github/ISSUE_TEMPLATE/**'
18+
- '.github/CODEOWNERS'
19+
- 'sycl/doc/**'
20+
- 'sycl/gdb/**'
21+
- 'clang/docs/**'
22+
- '**.md'
23+
- '**.rst'
24+
- '.github/workflows/sycl-windows-*.yml'
25+
- '.github/workflows/sycl-macos-*.yml'
26+
- '.github/workflows/sycl-nightly.yml'
27+
- '.github/workflows/sycl-rel-nightly.yml'
28+
- 'devops/containers/**'
29+
- 'devops/actions/build_container/**'
30+
31+
concurrency:
32+
# Cancel a currently running workflow from the same PR, branch or tag.
33+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
34+
cancel-in-progress: true
35+
36+
permissions: read-all
37+
38+
jobs:
39+
detect_changes:
40+
uses: ./.github/workflows/sycl-detect-changes.yml
41+
42+
# TODO: If UR is merged into llvm it will require changes:
43+
# - 'detect_changes' should be required for all UR jobs
44+
# - 'if' condition should be used, for all UR jobs, to check if UR is affected
45+
# (see example test_job's if)
46+
# - test_job should be removed
47+
#
48+
test_job:
49+
# this is a temporary test job, to show how the 'if' should be used for all UR jobs
50+
name: UR test job
51+
needs: [detect_changes]
52+
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Check if UR is affected
57+
run: |
58+
echo "UR affected"
59+
echo 'Filters set: ${{needs.detect_changes.outputs.filters}}'
60+
61+
source_checks:
62+
name: Source Checks
63+
needs: [detect_changes]
64+
uses: ./.github/workflows/ur-source-checks.yml
65+
66+
adapters:
67+
name: Adapters
68+
needs: [source_checks]
69+
strategy:
70+
matrix:
71+
# Extra native CPU jobs are here to force the loader to be used.
72+
# UR will not use the loader if there is only one target.
73+
adapter: [
74+
{name: L0, runner: UR_L0},
75+
{name: L0_V2, runner: UR_L0},
76+
{name: L0, runner: UR_L0, static: ON},
77+
{name: OPENCL, runner: UR_OPENCL, platform: "Intel(R) OpenCL"},
78+
{name: CUDA, runner: UR_CUDA},
79+
{name: HIP, runner: UR_HIP},
80+
{name: NATIVE_CPU, runner: UR_NATIVE_CPU},
81+
{name: OPENCL, runner: UR_OPENCL, other_adapter: NATIVE_CPU, platform: "OPENCL:Intel(R) OpenCL"},
82+
{name: L0, runner: UR_L0, other_adapter: NATIVE_CPU},
83+
]
84+
uses: ./.github/workflows/ur-build-hw.yml
85+
with:
86+
adapter_name: ${{ matrix.adapter.name }}
87+
runner_name: ${{ matrix.adapter.runner }}
88+
static_loader: ${{ matrix.adapter.static || 'OFF' }}
89+
static_adapter: ${{ matrix.adapter.static || 'OFF' }}
90+
platform: ${{ matrix.adapter.platform || '' }}
91+
other_adapter_name: ${{ matrix.adapter.other_adapter || '' }}
92+
93+
macos:
94+
name: MacOS build only
95+
needs: [source_checks]
96+
strategy:
97+
matrix:
98+
os: ['macos-13']
99+
runs-on: ${{matrix.os}}
100+
101+
steps:
102+
# TODO: If UR is merged into llvm it will require changes:
103+
# - checkout only llvm repo
104+
# - configure UR project from local tree
105+
#
106+
- name: Checkout LLVM
107+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
108+
109+
- name: Checkout UR
110+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
111+
with:
112+
repository: 'oneapi-src/unified-runtime'
113+
path: unified-runtime
114+
ref: main
115+
fetch-depth: 1
116+
117+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
118+
with:
119+
python-version: 3.9
120+
121+
- name: Install prerequisites
122+
working-directory: ${{github.workspace}}/unified-runtime
123+
run: python3 -m pip install -r third_party/requirements.txt
124+
125+
- name: Install hwloc
126+
run: brew install hwloc
127+
128+
- name: Configure CMake
129+
working-directory: ${{github.workspace}}/unified-runtime
130+
run: >
131+
cmake
132+
-B${{github.workspace}}/build
133+
-DUR_ENABLE_TRACING=ON
134+
-DUR_DEVELOPER_MODE=ON
135+
-DCMAKE_BUILD_TYPE=Release
136+
-DUR_BUILD_TESTS=ON
137+
-DUR_FORMAT_CPP_STYLE=ON
138+
-DUMF_ENABLE_POOL_TRACKING=ON
139+
140+
- name: Build
141+
run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

0 commit comments

Comments
 (0)