Skip to content

Commit e672cda

Browse files
committed
Restrict number of cores used
1 parent 0a8b0d2 commit e672cda

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

devops/actions/run-tests/benchmark/action.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@ runs:
4646
echo "# This workflow is not guaranteed to work with other backends."
4747
echo "#" ;;
4848
esac
49+
- name: Compute CPU core range to run benchmarks on
50+
run: |
51+
# Taken from ur-benchmark-reusable.yml:
52+
53+
# Compute the core range for the first NUMA node; second node is used by
54+
# UMF. Skip the first 4 cores as the kernel is likely to schedule more
55+
# work on these.
56+
CORES="$(lscpu | awk '
57+
/NUMA node0 CPU|On-line CPU/ {line=$0}
58+
END {
59+
split(line, a, " ")
60+
split(a[4], b, ",")
61+
sub(/^0/, "4", b[1])
62+
print b[1]
63+
}')"
64+
echo "CPU core range to use: $CORES"
65+
echo "CORES=$CORES" >> $GITHUB_ENV
66+
67+
ZE_AFFINITY_MASK=0
68+
echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV
4969
- name: Run compute-benchmarks
5070
shell: bash
5171
run: |
@@ -69,7 +89,7 @@ runs:
6989
echo "-----"
7090
sycl-ls
7191
echo "-----"
72-
./devops/scripts/benchmarking/benchmark.sh -n '${{ runner.name }}' -s || exit 1
92+
taskset -c "$CORES" ./devops/scripts/benchmarking/benchmark.sh -n '${{ runner.name }}' -s || exit 1
7393
- name: Push compute-benchmarks results
7494
if: always()
7595
shell: bash

0 commit comments

Comments
 (0)