Skip to content

Commit b5f4a93

Browse files
authored
Merge pull request #2464 from oneapi-src/test-taskset
[benchmarks] pin benchmarks to specific cores
2 parents b7047f6 + 569f4f2 commit b5f4a93

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/benchmarks-reusable.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,25 @@ jobs:
176176
- name: Build UMF
177177
run: cmake --build ${{github.workspace}}/umf_build -j $(nproc)
178178

179+
- name: Compute core range
180+
run: |
181+
# Compute the core range for the first NUMA node, skipping the first 4 cores.
182+
# This is to avoid the first cores that the kernel is likely to schedule more work on.
183+
CORES=$(lscpu | awk '
184+
/NUMA node0 CPU|On-line CPU/ {line=$0}
185+
END {
186+
split(line, a, " ")
187+
split(a[4], b, ",")
188+
sub(/^0/, "4", b[1])
189+
print b[1]
190+
}')
191+
echo "CORES=$CORES" >> $GITHUB_ENV
192+
179193
- name: Run benchmarks
180194
working-directory: ${{ github.workspace }}/ur-repo/
181195
id: benchmarks
182196
run: >
183-
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
197+
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
184198
~/bench_workdir
185199
--sycl ${{ github.workspace }}/sycl_build
186200
--ur ${{ github.workspace }}/ur_install

scripts/benchmarks/benches/umf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def benchmarks(self) -> list[Benchmark]:
4343

4444
class ComputeUMFBenchmark(Benchmark):
4545
def __init__(self, bench, name):
46+
super().__init__(bench.directory, bench)
47+
4648
self.bench = bench
4749
self.bench_name = name
4850
self.oneapi = get_oneapi()
@@ -55,8 +57,6 @@ def __init__(self, bench, name):
5557

5658
self.col_statistics_time = None
5759

58-
super().__init__(bench.directory)
59-
6060
def bin_args(self) -> list[str]:
6161
return []
6262

0 commit comments

Comments
 (0)