Skip to content

[CI][UR] Disable UR benchmarking workflows #17281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 6 additions & 192 deletions .github/workflows/ur-benchmarks-reusable.yml
Original file line number Diff line number Diff line change
@@ -1,198 +1,12 @@
name: Benchmarks Reusable

on:
workflow_call:
inputs:
str_name:
required: true
type: string
pr_no:
required: true
# 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:
required: false
type: string
default: ''
upload_report:
required: false
type: boolean
default: false
compute_runtime_commit:
required: false
type: string
default: ''
# This workflow is a WIP: This workflow file acts as a placeholder.

permissions:
contents: read
pull-requests: write
on: [ workflow_call ]

jobs:
bench-run:
name: Build SYCL, Run Benchmarks
strategy:
matrix:
adapter: [
{str_name: "${{ inputs.str_name }}",
sycl_config: "${{ inputs.sycl_config_params }}"
}
]
build_type: [Release]
compiler: [{c: clang, cxx: clang++}]

runs-on: "PVC_PERF"

do-nothing:
runs-on: ubuntu-latest
steps:
- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.pr_no != 0 }}
with:
script: |
const pr_no = '${{ inputs.pr_no }}';
const adapter = '${{ matrix.adapter.str_name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const params = '${{ inputs.bench_script_params }}';
const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}`;

github.rest.issues.createComment({
issue_number: pr_no,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})

- name: Checkout SYCL
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: sycl-repo

# 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
if: ${{ inputs.pr_no != 0 }}
working-directory: ${{github.workspace}}/sycl-repo
run: |
git fetch -- https://github.com/${{github.repository}} +refs/pull/${{ inputs.pr_no }}/*:refs/remotes/origin/pr/${{ inputs.pr_no }}/*
git checkout origin/pr/${{ inputs.pr_no }}/merge
git rev-parse origin/pr/${{ inputs.pr_no }}/merge

- name: Install pip packages
run: |
pip install --force-reinstall -r ${{github.workspace}}/sycl-repo/unified-runtime/scripts/benchmarks/requirements.txt

- name: Configure SYCL
run: >
python3 sycl-repo/buildbot/configure.py
-t ${{matrix.build_type}}
-o ${{github.workspace}}/sycl_build
--cmake-gen "Ninja"
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
--cmake-opt="-DSYCL_PI_TESTS=OFF"
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
${{matrix.adapter.sycl_config}}

- name: Build SYCL
run: cmake --build ${{github.workspace}}/sycl_build -j $(nproc)

# We need a complete installed UR for compute-benchmarks.
- name: Configure UR
run: >
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-S${{github.workspace}}/sycl-repo/unified-runtime
-B${{github.workspace}}/ur_build
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install
-DUR_BUILD_TESTS=OFF
-DUR_BUILD_ADAPTER_L0=ON
-DUR_BUILD_ADAPTER_L0_V2=ON
-DUMF_DISABLE_HWLOC=ON

- name: Build UR
run: cmake --build ${{github.workspace}}/ur_build -j $(nproc)

- name: Install UR
run: cmake --install ${{github.workspace}}/ur_build

- name: Compute core range
run: |
# Compute the core range for the first NUMA node; second node is for UMF jobs.
# Skip the first 4 cores - the kernel is likely to schedule more work on these.
CORES="$(lscpu | awk '
/NUMA node0 CPU|On-line CPU/ {line=$0}
END {
split(line, a, " ")
split(a[4], b, ",")
sub(/^0/, "4", b[1])
print b[1]
}')"
echo "Selected core: $CORES"
echo "CORES=$CORES" >> $GITHUB_ENV

ZE_AFFINITY_MASK=0
echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV

- name: Run benchmarks
working-directory: ${{ github.workspace }}
id: benchmarks
run: >
taskset -c "${{ env.CORES }}" ${{ github.workspace }}/sycl-repo/unified-runtime/scripts/benchmarks/main.py
~/llvm_bench_workdir
--sycl ${{ github.workspace }}/sycl_build
--ur ${{ github.workspace }}/ur_install
--adapter ${{ matrix.adapter.str_name }}
--compare baseline
--compute-runtime ${{ inputs.compute_runtime_commit }}
--build-igc
${{ inputs.upload_report && '--output-html' || '' }}
${{ inputs.pr_no != 0 && '--output-markdown' || '' }}
${{ inputs.bench_script_params }}

- name: Print benchmark results
run: |
cat ${{ github.workspace }}/benchmark_results.md || true

- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.pr_no != 0 }}
with:
script: |
let markdown = ""
try {
const fs = require('fs');
markdown = fs.readFileSync('benchmark_results.md', 'utf8');
} catch(err) {
}

const pr_no = '${{ inputs.pr_no }}';
const adapter = '${{ matrix.adapter.str_name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const test_status = '${{ steps.benchmarks.outcome }}';
const job_status = '${{ job.status }}';
const params = '${{ inputs.bench_script_params }}';
const body = `Benchmarks ${adapter} run (${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;

github.rest.issues.createComment({
issue_number: pr_no,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})

- name: Rename benchmark results file
if: ${{ always() && inputs.upload_report }}
run: mv benchmark_results.html benchmark_results_${{ inputs.pr_no }}.html

- name: Upload HTML report
if: ${{ always() && inputs.upload_report }}
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: benchmark_results_${{ inputs.pr_no }}.html
key: benchmark-results-${{ inputs.pr_no }}-${{ matrix.adapter.str_name }}-${{ github.run_id }}

- name: Get information about platform
if: ${{ always() }}
run: ${{github.workspace}}/sycl-repo/unified-runtime/.github/scripts/get_system_info.sh
- run: echo 'This workflow is a WIP.'

55 changes: 7 additions & 48 deletions .github/workflows/ur-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,12 @@
name: Benchmarks

on:
workflow_dispatch:
inputs:
str_name:
description: Adapter
type: choice
required: true
default: 'level_zero'
options:
- level_zero
- level_zero_v2
pr_no:
description: PR number (0 is sycl main branch)
type: number
required: true
bench_script_params:
description: Benchmark script arguments
type: string
required: false
default: ''
sycl_config_params:
description: Extra params for SYCL configuration
type: string
required: false
default: ''
compute_runtime_commit:
description: 'Compute Runtime commit'
type: string
required: false
default: ''
upload_report:
description: 'Upload HTML report'
type: boolean
required: false
default: false
# This workflow is a WIP: this workflow file acts as a placeholder.

permissions:
contents: read
pull-requests: write
on: [ workflow_dispatch ]

jobs:
manual:
name: Compute Benchmarks
uses: ./.github/workflows/ur-benchmarks-reusable.yml
with:
str_name: ${{ inputs.str_name }}
pr_no: ${{ inputs.pr_no }}
bench_script_params: ${{ inputs.bench_script_params }}
sycl_config_params: ${{ inputs.sycl_config_params }}
compute_runtime_commit: ${{ inputs.compute_runtime_commit }}
upload_report: ${{ inputs.upload_report }}
do-nothing:
runs-on: ubuntu-latest
steps:
- run: echo 'This workflow is a WIP.'

Loading