Skip to content

Commit a126c93

Browse files
[CI] Update benchmark's workflow to use self-hosted runner
1 parent 7e08a77 commit a126c93

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

.github/workflows/reusable_benchmarks.yml

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Executes benchmarks implemented in this repository
2-
# using scripts for benchmark results visualisation,
2+
# using scripts for benchmark results visualization,
33
# which are downloaded from Unified Runtime repository.
44
name: Benchmarks
55

@@ -31,10 +31,8 @@ env:
3131
jobs:
3232
benchmarks:
3333
name: Benchmarks
34-
strategy:
35-
matrix:
36-
os: ['ubuntu-latest']
37-
runs-on: ${{matrix.os}}
34+
35+
runs-on: L0_PERF
3836

3937
steps:
4038
# Workspace on self-hosted runners is not cleaned automatically.
@@ -79,12 +77,7 @@ jobs:
7977
git checkout origin/pr/${PR_NO}/merge
8078
git rev-parse origin/pr/${PR_NO}/merge
8179
82-
- name: Install apt packages
83-
run: |
84-
sudo apt-get update
85-
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
86-
87-
- name: Configure build
80+
- name: Configure UMF
8881
run: >
8982
cmake
9083
-S ${{env.UMF_DIR}}
@@ -94,19 +87,19 @@ jobs:
9487
-DUMF_BUILD_BENCHMARKS=ON
9588
-DUMF_BUILD_BENCHMARKS_MT=ON
9689
-DUMF_BUILD_TESTS=OFF
97-
-DUMF_FORMAT_CODE_STYLE=OFF
90+
-DUMF_BUILD_EXAMPLES=OFF
9891
-DUMF_DEVELOPER_MODE=OFF
92+
-DUMF_FORMAT_CODE_STYLE=OFF
9993
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
10094
-DUMF_BUILD_CUDA_PROVIDER=ON
10195
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
10296
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
103-
-DUMF_BUILD_EXAMPLES=OFF
10497
10598
- name: Build UMF
10699
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
107100

108101
# We are going to clone Unified Runtime repository in order to run
109-
# the most up-to-date UR scripts for benchmark data visualisation
102+
# the most up-to-date UR scripts for benchmark data visualization
110103
- name: Checkout UR
111104
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112105
with:
@@ -119,13 +112,31 @@ jobs:
119112
run: |
120113
pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
121114
122-
- name: Run dedicated for UMF benchmarking scripts from UR
115+
- name: Set core range and GPU mask
116+
run: |
117+
# Compute the core range for the second NUMA node; first node is for UR jobs.
118+
# Skip the first 4 cores - the kernel is likely to schedule more work on these.
119+
CORES=$(lscpu | awk '
120+
/NUMA node1 CPU|On-line CPU/ {line=$0}
121+
END {
122+
split(line, a, " ")
123+
split(a[4], b, ",")
124+
sub(/^0/, "4", b[1])
125+
print b[1]
126+
}')
127+
echo "Selected core: $CORES"
128+
echo "CORES=$CORES" >> $GITHUB_ENV
129+
130+
ZE_AFFINITY_MASK=1
131+
echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV
132+
133+
- name: Run UMF benchmarks (using scripts from UR)
123134
id: benchmarks
124135
working-directory: ${{env.BUILD_DIR}}
125136
run: >
126-
${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
127-
~/bench_workdir
128-
--umf ${{env.BUILD_DIR}}
137+
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
138+
~/bench_workdir_umf
139+
--umf ${{env.BUILD_DIR}}
129140
${{ inputs.upload_report && '--output-html' || '' }}
130141
${{ inputs.bench_script_params }}
131142
@@ -161,3 +172,8 @@ jobs:
161172
with:
162173
path: umf-repo/build/benchmark_results.html
163174
key: benchmark-results-${{ github.run_id }}
175+
176+
- name: Get information about platform
177+
if: ${{ always() }}
178+
working-directory: ${{env.UMF_DIR}}
179+
run: .github/scripts/get_system_info.sh

0 commit comments

Comments
 (0)