Skip to content

Commit

Permalink
[benchmarks] pin benchmarks to specific cores
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pbalcer committed Dec 13, 2024
1 parent 4739d4c commit f9efc51
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/benchmarks-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,18 @@ jobs:
- name: Run benchmarks
working-directory: ${{ github.workspace }}/ur-repo/
id: benchmarks
run: >
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
run: |
# Compute the core range for the first NUMA node, skipping the first 4 cores.
# This is to avoid the first cores that the kernel is likely to schedule more work on.
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]
}')
taskset -c $CORES ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
~/bench_workdir
--sycl ${{ github.workspace }}/sycl_build
--ur ${{ github.workspace }}/ur_install
Expand Down

0 comments on commit f9efc51

Please sign in to comment.