Skip to content

Commit

Permalink
Reduce CI matrix in preparation for repo move
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenzie committed Jan 21, 2025
1 parent f058cb2 commit cf31685
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 242 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build-hw-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ jobs:
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW
strategy:
matrix:
adapter: [{
name: "${{inputs.adapter_name}}",
other_name: "${{inputs.other_adapter_name}}",
platform: "${{inputs.platform}}",
static_Loader: "${{inputs.static_loader}}",
static_adapter: "${{inputs.static_loader}}"
}]
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}]
adapter: [
{
name: "${{inputs.adapter_name}}",
other_name: "${{inputs.other_adapter_name}}",
platform: "${{inputs.platform}}",
static_Loader: "${{inputs.static_loader}}",
static_adapter: "${{inputs.static_loader}}"
}
]
build_type: [Release]
compiler: [{c: gcc, cxx: g++}]
# TODO: The latest L0 loader segfaults when built with clang.
exclude:
- adapter: {name: L0, platform: ""}
Expand Down
246 changes: 13 additions & 233 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: Unified Runtime

on: [push, pull_request]

Expand All @@ -11,146 +11,22 @@ permissions:
pull-requests: write

jobs:
ubuntu-build:
name: Build - Ubuntu
strategy:
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04']
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}]
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF']
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON', '-DUMF_ENABLE_POOL_TRACKING=OFF']
latency_tracking: ['-DUR_ENABLE_LATENCY_HISTOGRAM=OFF']
include:
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: clang, cxx: clang++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: gcc, cxx: g++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: clang, cxx: clang++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
- os: 'ubuntu-20.04'
build_type: Release
compiler: {c: gcc-7, cxx: g++-7}
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: clang, cxx: clang++}
latency_tracking: '-DUR_ENABLE_LATENCY_HISTOGRAM=ON'
runs-on: ${{ (matrix.os == 'ubuntu-22.04' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y ${{matrix.compiler.c}} devscripts
- name: Install libhwloc
run: .github/scripts/install_hwloc.sh

- name: Setup PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install g++-7
if: matrix.compiler.cxx == 'g++-7'
run: |
sudo apt-get install -y ${{matrix.compiler.cxx}}
- name: Install libbacktrace
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
cd libbacktrace
./configure
make
sudo make install
cd ..
- name: Download DPC++
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt install libncurses5
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
mkdir -p ${{github.workspace}}/dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
- name: Configure CMake
if: matrix.os == 'ubuntu-22.04'
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUR_ENABLE_TRACING=ON
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=OFF
-DUR_DEVELOPER_MODE=ON
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
-DUR_CONFORMANCE_TEST_LOADER=OFF
${{matrix.libbacktrace}}
${{matrix.pool_tracking}}
${{matrix.latency_tracking}}
- name: Configure CMake
if: matrix.os == 'ubuntu-20.04'
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109
# Note: Disable Werror, since 20.04 raises different ones than 22.04
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUR_ENABLE_TRACING=ON
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=OFF
-DUR_DEVELOPER_MODE=OFF
${{matrix.libbacktrace}}
${{matrix.pool_tracking}}
${{matrix.latency_tracking}}
- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc)

- name: Verify hardening flags have been set
run: cmake --build ${{github.workspace}}/build --target verify-hardening
# https://github.com/oneapi-src/unified-runtime/issues/2120
if: ${{ matrix.compiler.cxx != 'clang++' && matrix.os != 'ubuntu-20.04' }}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"

fuzztest:
name: Fuzz tests short
uses: ./.github/workflows/build-fuzz-reusable.yml
with:
test_label: "fuzz-short"

level-zero:
name: Level Zero
name: CTS - Level Zero
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: L0
runner_name: L0

level-zero-v2:
name: Level Zero V2
name: CTS - Level Zero V2
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: L0_V2
runner_name: L0

level-zero-static:
name: Level Zero static
name: CTS - Level Zero static
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: L0
Expand All @@ -159,37 +35,37 @@ jobs:
static_adapter: ON

opencl:
name: OpenCL
name: CTS - OpenCL
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: OPENCL
runner_name: OPENCL
platform: "Intel(R) OpenCL"

cuda:
name: CUDA
name: CTS - CUDA
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: CUDA
runner_name: CUDA

hip:
name: HIP
name: CTS - HIP
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: HIP
runner_name: HIP

native-cpu:
name: Native CPU
name: CTS - Native CPU
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: NATIVE_CPU
runner_name: NATIVE_CPU

# Native CPU jobs are here to force the loader to be used (UR will not use the loader if there is only one target)
combined-opencl-native-cpu:
name: OpenCL + Native CPU (Loader)
name: CTS - OpenCL + Native CPU (Loader)
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: OPENCL
Expand All @@ -198,114 +74,18 @@ jobs:
platform: "OPENCL:Intel(R) OpenCL"

combined-level-zero-native-cpu:
name: Level Zero + Native CPU (Loader)
name: CTS - Level Zero + Native CPU (Loader)
uses: ./.github/workflows/build-hw-reusable.yml
with:
adapter_name: L0
other_adapter_name: NATIVE_CPU
runner_name: L0

e2e-level-zero:
name: E2E L0
permissions:
contents: read
pull-requests: write
needs: [ubuntu-build, level-zero]
uses: ./.github/workflows/e2e_level_zero.yml

e2e-opencl:
name: E2E OpenCL
permissions:
contents: read
pull-requests: write
needs: [ubuntu-build, opencl]
uses: ./.github/workflows/e2e_opencl.yml

# Causes hangs: https://github.com/oneapi-src/unified-runtime/issues/2398
#e2e-cuda:
# name: E2E CUDA
# permissions:
# contents: read
# pull-requests: write
# needs: [ubuntu-build, cuda]
# uses: ./.github/workflows/e2e_cuda.yml

windows-build:
name: Build - Windows
strategy:
matrix:
os: ['windows-2019', 'windows-2022']
adapter: [
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'},
{name: None, var: ''}, {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'},
{name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'}
]

# TODO: building level zero loader on windows-2019 and clang-cl is currently broken
exclude:
- os: 'windows-2019'
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
- os: 'windows-2019'
adapter: {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'}
- os: 'windows-2019'
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'}
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}
compiler: {c: clang-cl, cxx: clang-cl}
- adapter: {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'}
compiler: {c: clang-cl, cxx: clang-cl}
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'}
compiler: {c: clang-cl, cxx: clang-cl}

build_type: [Debug, Release]
# TODO: clang-cl seems to be fully broken (https://github.com/oneapi-src/unified-runtime/issues/2348)
#compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
compiler: [{c: cl, cxx: cl}]
include:
#- compiler: {c: clang-cl, cxx: clang-cl}
# toolset: "-T ClangCL"
- os: 'windows-2022'
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'}
build_type: 'Release'
compiler: {c: cl, cxx: cl}

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install hwloc
run: vcpkg install hwloc:x64-windows

- name: Configure CMake
env:
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
run: >
cmake
-B${{github.workspace}}/build
${{matrix.toolset}}
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=OFF
-DUR_CONFORMANCE_TEST_LOADER=OFF
${{matrix.adapter.var}}
- name: Build all
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"

macos-build:
name: Build - MacOS
name: Build - macOS
strategy:
matrix:
os: ['macos-13']
matrix:
os: ['macos-13']
runs-on: ${{matrix.os}}

steps:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Fuzz Testing
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write

jobs:
fuzztest:
name: Fuzz tests short
uses: ./.github/workflows/build-fuzz-reusable.yml
with:
test_label: "fuzz-short"

0 comments on commit cf31685

Please sign in to comment.