-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 it 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.
- Loading branch information
Showing
8 changed files
with
229 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[.github/workflows/*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: CUDA | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter: | ||
if: github.repository == 'oneapi-src/unified-runtime' | ||
uses: ./.github/workflows/build-hw-reusable.yml | ||
with: | ||
name: CUDA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: HIP | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter: | ||
if: github.repository == 'oneapi-src/unified-runtime' | ||
uses: ./.github/workflows/build-hw-reusable.yml | ||
with: | ||
name: HIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: Level Zero | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter: | ||
if: github.repository == 'oneapi-src/unified-runtime' | ||
uses: ./.github/workflows/build-hw-reusable.yml | ||
with: | ||
name: L0 | ||
|
||
examples: | ||
name: Examples on HW | ||
# if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW | ||
if: false # temporaily disabled due to conda env setup issues | ||
strategy: | ||
matrix: | ||
adapter: [ | ||
{name: L0} | ||
] | ||
build_type: [Debug, Release] | ||
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] | ||
|
||
runs-on: ${{matrix.adapter.name}} | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Install pip packages | ||
run: pip install -r third_party/requirements.txt | ||
|
||
- name: Init conda env | ||
uses: conda-incubator/setup-miniconda@9f54435e0e72c53962ee863144e47a4b094bfd35 # v2.3.0 | ||
with: | ||
miniconda-version: "latest" | ||
activate-environment: examples | ||
environment-file: third_party/deps.yml | ||
auto-activate-base: false | ||
|
||
- name: Configure CMake | ||
shell: bash -el {0} | ||
run: > | ||
cmake | ||
-B${{github.workspace}}/build | ||
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | ||
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON | ||
-DUR_BUILD_EXAMPLE_CODEGEN=ON | ||
-DUR_DEVELOPER_MODE=ON | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build -j $(nproc) | ||
|
||
- name: Test codegen example | ||
working-directory: ${{github.workspace}}/build | ||
run: bin/codegen | ||
|
||
# conda init adds content to user's profile making it failing (if conda is gone) | ||
- name: Cleanup after conda init | ||
run: | | ||
cat ${HOME}/.profile || true | ||
rm ${HOME}/.profile || true | ||
- name: Get information about platform | ||
if: ${{ always() }} | ||
run: .github/scripts/get_system_info.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Native CPU | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter: | ||
if: github.repository == 'oneapi-src/unified-runtime' | ||
uses: ./.github/workflows/build-hw-reusable.yml | ||
with: | ||
name: NATIVE_CPU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: OpenCL | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter: | ||
if: github.repository == 'oneapi-src/unified-runtime' | ||
uses: ./.github/workflows/build-hw-reusable.yml | ||
with: | ||
name: OPENCL | ||
platform: "Intel(R) OpenCL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
name: Build - Adapters on HW - Reusable | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
platform: | ||
required: false | ||
type: string | ||
default: "" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
adapter-build-hw: | ||
name: Build & Test HW | ||
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks won't have the HW | ||
strategy: | ||
matrix: | ||
adapter: [ | ||
{name: "${{inputs.name}}", platform: "${{inputs.platform}}"}, | ||
] | ||
build_type: [Debug, Release] | ||
compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] | ||
# TODO: The latest L0 loader segfaults when built with clang. | ||
exclude: | ||
- adapter: {name: L0, platform: ""} | ||
compiler: {c: clang, cxx: clang++} | ||
|
||
runs-on: ${{matrix.adapter.name}} | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Install pip packages | ||
run: pip install -r third_party/requirements.txt | ||
|
||
- name: Download DPC++ | ||
run: | | ||
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz | ||
mkdir dpcpp_compiler | ||
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler | ||
- name: Configure CMake | ||
run: > | ||
cmake | ||
-B${{github.workspace}}/build | ||
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | ||
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | ||
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | ||
-DUR_ENABLE_TRACING=ON | ||
-DUR_DEVELOPER_MODE=ON | ||
-DUR_BUILD_TESTS=ON | ||
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON | ||
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | ||
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib | ||
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }} | ||
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }} | ||
- name: Build | ||
# This is so that device binaries can find the sycl runtime library | ||
run: cmake --build ${{github.workspace}}/build -j $(nproc) | ||
|
||
- name: Test adapter specific | ||
working-directory: ${{github.workspace}}/build | ||
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180 | ||
|
||
- name: Test adapters | ||
working-directory: ${{github.workspace}}/build | ||
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180 | ||
|
||
- name: Get information about platform | ||
if: ${{ always() }} | ||
run: .github/scripts/get_system_info.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters