Skip to content

Commit f9efc51

Browse files
committed
[benchmarks] pin benchmarks to specific cores
Currently we use numactl to pin the benchmark scripts to an entire numa node. However, after some testing, this proved to be insufficient to make all the benchmarks stable. This patch will change the workflow to now use taskset to pin the benchmark script to physical cores of the first numa node, with the exception for the first four, which are more likely to be used by the kernel for bookkeeping work or e.g., handling interrupts.
1 parent 4739d4c commit f9efc51

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/benchmarks-reusable.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,18 @@ jobs:
179179
- name: Run benchmarks
180180
working-directory: ${{ github.workspace }}/ur-repo/
181181
id: benchmarks
182-
run: >
183-
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
182+
run: |
183+
# Compute the core range for the first NUMA node, skipping the first 4 cores.
184+
# This is to avoid the first cores that the kernel is likely to schedule more work on.
185+
CORES=$(lscpu | awk '
186+
/NUMA node0 CPU|On-line CPU/ {line=$0}
187+
END {
188+
split(line, a, " ")
189+
split(a[4], b, ",")
190+
sub(/^0/, "4", b[1])
191+
print b[1]
192+
}')
193+
taskset -c $CORES ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
184194
~/bench_workdir
185195
--sycl ${{ github.workspace }}/sycl_build
186196
--ur ${{ github.workspace }}/ur_install

0 commit comments

Comments
 (0)