Skip to content

Commit

Permalink
Merge branch 'sycl' into reuse-shadow-memory
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaomaosu committed Nov 27, 2024
2 parents 44cdf51 + e0f22b5 commit 88c25e9
Show file tree
Hide file tree
Showing 273 changed files with 8,815 additions and 4,840 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ loader:
opencl:
- changed-files:
- any-glob-to-any-file:
- source/adapter/opencl/**
- source/adapters/opencl/**

level-zero:
- changed-files:
Expand Down

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/benchmarks-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Compute Benchmarks Nightly

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day

permissions:
contents: read
pull-requests: write

jobs:
nightly:
name: Compute Benchmarks Nightly level-zero
uses: ./.github/workflows/benchmarks-reusable.yml
with:
str_name: 'level_zero'
unit: 'gpu'
pr_no: 0
bench_script_params: '--save baseline'
sycl_config_params: ''
sycl_repo: 'intel/llvm'
sycl_commit: ''

nightly2:
# we need to wait until previous job is done so that the html report
# contains both runs
needs: nightly
name: Compute Benchmarks Nightly level-zero v2
uses: ./.github/workflows/benchmarks-reusable.yml
with:
str_name: 'level_zero_v2'
unit: 'gpu'
pr_no: 0
bench_script_params: '--save baseline-v2'
sycl_config_params: ''
sycl_repo: 'intel/llvm'
sycl_commit: ''
upload_report: true
Original file line number Diff line number Diff line change
@@ -1,50 +1,39 @@
name: Compute Benchmarks
name: Benchmarks Reusable

on:
# Can be triggered via manual "dispatch" (from workflow view in GitHub Actions tab)
workflow_dispatch:
# acceptable input for adapter-specific runs
workflow_call:
inputs:
str_name:
description: Formatted adapter name
type: choice
required: true
default: 'level_zero'
options:
- level_zero
- level_zero_v2
type: string
unit:
description: Test unit (cpu/gpu)
type: choice
required: true
default: 'gpu'
options:
- cpu
- gpu
type: string
pr_no:
description: PR number (if 0, it'll run on the main)
type: number
required: true
bench_script_params:
description: Parameters passed to script executing benchmark
# even though this is a number, this is a workaround for issues with
# reusable workflow calls that result in "Unexpected value '0'" error.
type: string
bench_script_params:
required: false
type: string
default: ''
sycl_config_params:
description: Extra params for SYCL configuration
type: string
required: false
type: string
default: ''
sycl_repo:
description: 'Compiler repo'
type: string
required: true
type: string
default: 'intel/llvm'
sycl_commit:
description: 'Compiler commit'
type: string
required: false
type: string
default: ''
upload_report:
required: false
type: boolean
default: false

permissions:
contents: read
Expand All @@ -56,19 +45,17 @@ jobs:
strategy:
matrix:
adapter: [
{str_name: "${{inputs.str_name}}",
sycl_config: "${{inputs.sycl_config_params}}",
unit: "${{inputs.unit}}"
{str_name: "${{ inputs.str_name }}",
sycl_config: "${{ inputs.sycl_config_params }}",
unit: "${{ inputs.unit }}"
}
]
build_type: [Release]
compiler: [{c: clang, cxx: clang++}]

runs-on: "${{inputs.str_name}}_PERF"
runs-on: "${{ inputs.str_name }}_PERF"

steps:
# Workspace on self-hosted runners is not cleaned automatically.
# We have to delete the files created outside of using actions.
- name: Cleanup self-hosted workspace
if: always()
run: |
Expand Down Expand Up @@ -99,7 +86,8 @@ jobs:
path: ur-repo

- name: Install pip packages
run: pip install -r ${{github.workspace}}/ur-repo/third_party/requirements.txt
run: |
pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
# We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
- name: Fetch PR's merge commit
Expand Down Expand Up @@ -169,13 +157,15 @@ jobs:
run: cmake --install ${{github.workspace}}/ur_build

- name: Run benchmarks
working-directory: ${{ github.workspace }}/ur-repo/
id: benchmarks
run: >
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
~/bench_workdir
${{github.workspace}}/sycl_build
${{github.workspace}}/ur_install
${{ matrix.adapter.str_name }}
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
~/bench_workdir
--sycl ${{ github.workspace }}/sycl_build
--ur ${{ github.workspace }}/ur_install
--adapter ${{ matrix.adapter.str_name }}
${{ inputs.upload_report && '--output-html' || '' }}
${{ inputs.bench_script_params }}
- name: Add comment to PR
Expand All @@ -186,7 +176,7 @@ jobs:
let markdown = ""
try {
const fs = require('fs');
markdown = fs.readFileSync('benchmark_results.md', 'utf8');
markdown = fs.readFileSync('ur-repo/benchmark_results.md', 'utf8');
} catch(err) {
}
Expand All @@ -204,3 +194,10 @@ jobs:
repo: context.repo.repo,
body: body
})
- name: Upload HTML report
if: ${{ always() && inputs.upload_report }}
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ur-repo/benchmark_results.html
key: benchmark-results-${{ matrix.adapter.str_name }}-${{ github.run_id }}
68 changes: 68 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Compute Benchmarks

on:
workflow_dispatch:
inputs:
str_name:
description: Formatted adapter name
type: choice
required: true
default: 'level_zero'
options:
- level_zero
- level_zero_v2
unit:
description: Test unit (cpu/gpu)
type: choice
required: true
default: 'gpu'
options:
- cpu
- gpu
pr_no:
description: PR number (if 0, it'll run on the main)
type: number
required: true
bench_script_params:
description: Parameters passed to script executing benchmark
type: string
required: false
default: ''
sycl_config_params:
description: Extra params for SYCL configuration
type: string
required: false
default: ''
sycl_repo:
description: 'Compiler repo'
type: string
required: true
default: 'intel/llvm'
sycl_commit:
description: 'Compiler commit'
type: string
required: false
default: ''
upload_report:
description: 'Upload HTML report'
type: boolean
required: false
default: false

permissions:
contents: read
pull-requests: write

jobs:
manual:
name: Compute Benchmarks
uses: ./.github/workflows/benchmarks-reusable.yml
with:
str_name: ${{ inputs.str_name }}
unit: ${{ inputs.unit }}
pr_no: ${{ inputs.pr_no }}
bench_script_params: ${{ inputs.bench_script_params }}
sycl_config_params: ${{ inputs.sycl_config_params }}
sycl_repo: ${{ inputs.sycl_repo }}
sycl_commit: ${{ inputs.sycl_commit }}
upload_report: ${{ inputs.upload_report }}
5 changes: 4 additions & 1 deletion .github/workflows/build-fuzz-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ jobs:
- name: Build level zero with gcc
run: |
git clone -b v1.17.6 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
git clone -b v1.18.5 --depth=1 https://github.com/oneapi-src/level-zero.git ${{github.workspace}}/level-zero
cd ${{github.workspace}}/level-zero
cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake --build build -j $(nproc)
- name: Configure CMake
# CFI sanitization (or flto?) seems to cause linking to fail
# https://github.com/oneapi-src/unified-runtime/issues/2323
run: >
cmake
-B${{github.workspace}}/build
Expand All @@ -58,6 +60,7 @@ jobs:
-DUR_USE_ASAN=ON
-DUR_USE_UBSAN=ON
-DUR_BUILD_ADAPTER_L0=ON
-DUR_USE_CFI=OFF
-DUR_LEVEL_ZERO_LOADER_LIBRARY=${{github.workspace}}/level-zero/build/lib/libze_loader.so
-DUR_LEVEL_ZERO_INCLUDE_DIR=${{github.workspace}}/level-zero/include/
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/build-hw-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ on:
adapter_name:
required: true
type: string
other_adapter_name:
required: false
type: string
default: ""
runner_name:
required: true
type: string
platform:
description: "Platform string, `UR_CTS_ADAPTER_PLATFORM` will be set to this."
required: false
type: string
default: ""
Expand Down Expand Up @@ -39,9 +44,13 @@ 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}}", platform: "${{inputs.platform}}", static_Loader: "${{inputs.static_loader}}", static_adapter: "${{inputs.static_loader}}"},
]
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++}]
# TODO: The latest L0 loader segfaults when built with clang.
Expand Down Expand Up @@ -73,6 +82,8 @@ jobs:
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
- name: Configure CMake
# CFI sanitization seems to fail on our CUDA nodes
# https://github.com/oneapi-src/unified-runtime/issues/2309
run: >
cmake
-B${{github.workspace}}/build
Expand All @@ -82,8 +93,10 @@ jobs:
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DUR_BUILD_TESTS=ON
-DUR_CONFORMANCE_TEST_LOADER=OFF
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
-DUR_CONFORMANCE_TEST_LOADER=${{ matrix.adapter.other_name != '' && 'ON' || 'OFF' }}
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
-DUR_USE_CFI=${{ matrix.adapter.name == 'CUDA' && 'OFF' || 'ON' }}
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
Expand All @@ -103,6 +116,8 @@ jobs:
- name: Test adapter specific
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
# Don't run adapter specific tests when building multiple adapters
if: ${{ matrix.adapter.other_name == '' }}

- name: Test adapters
working-directory: ${{github.workspace}}/build
Expand Down
Loading

0 comments on commit 88c25e9

Please sign in to comment.