From f9efc51198e5baaad7e84e17f2ec066234ca66a6 Mon Sep 17 00:00:00 2001 From: Piotr Balcer Date: Tue, 10 Dec 2024 14:56:15 +0100 Subject: [PATCH] [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. --- .github/workflows/benchmarks-reusable.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks-reusable.yml b/.github/workflows/benchmarks-reusable.yml index 6c00fbb04d..cd2edf902f 100644 --- a/.github/workflows/benchmarks-reusable.yml +++ b/.github/workflows/benchmarks-reusable.yml @@ -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