Skip to content

Commit

Permalink
Merge pull request #2464 from oneapi-src/test-taskset
Browse files Browse the repository at this point in the history
[benchmarks] pin benchmarks to specific cores
  • Loading branch information
pbalcer authored Dec 13, 2024
2 parents b7047f6 + 569f4f2 commit b5f4a93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/benchmarks-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,25 @@ jobs:
- name: Build UMF
run: cmake --build ${{github.workspace}}/umf_build -j $(nproc)

- name: Compute core range
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]
}')
echo "CORES=$CORES" >> $GITHUB_ENV
- name: Run benchmarks
working-directory: ${{ github.workspace }}/ur-repo/
id: benchmarks
run: >
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
~/bench_workdir
--sycl ${{ github.workspace }}/sycl_build
--ur ${{ github.workspace }}/ur_install
Expand Down
4 changes: 2 additions & 2 deletions scripts/benchmarks/benches/umf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def benchmarks(self) -> list[Benchmark]:

class ComputeUMFBenchmark(Benchmark):
def __init__(self, bench, name):
super().__init__(bench.directory, bench)

self.bench = bench
self.bench_name = name
self.oneapi = get_oneapi()
Expand All @@ -55,8 +57,6 @@ def __init__(self, bench, name):

self.col_statistics_time = None

super().__init__(bench.directory)

def bin_args(self) -> list[str]:
return []

Expand Down

0 comments on commit b5f4a93

Please sign in to comment.