Skip to content

Commit 348af53

Browse files
authored
[Nightly] Enable numactl for E2E test to reduce host bound models fluctuation (#1755)
Add numactl for E2E test to reduce host bound models fluctuation disable_all --------- Co-authored-by: mengfeil <test>
1 parent 34a9292 commit 348af53

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/actions/inductor-xpu-e2e-test/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ runs:
113113
}
114114
}
115115
set -xe
116+
xpu_list=($(xpu-smi discovery |grep 'DRM Device: /dev/' |sed 's/.*card//;s/[^0-9].*//' |awk '{if($1==0){print $1":"NR - 1}else{print $1 - 1":"NR - 1}}'))
117+
cores_per_instance="$(lscpu |grep -E 'Core\(s\) per socket:|Socket\(s\):' |awk -v i="${#xpu_list[*]}" 'BEGIN{sum=1}{sum*=$NF}END{print sum/i}')"
118+
export OMP_NUM_THREADS=${cores_per_instance}
116119
for suite in $(echo ${{ inputs.suite }} |sed 's/,/ /g')
117120
do
118121
if [ "${suite}" == "pt2e" ];then
@@ -133,15 +136,15 @@ runs:
133136
contains "accuracy,performance" $scenario
134137
$contains_status
135138
if [ "${MODEL_ONLY_NAME}" == "" ];then
136-
xpu_list=($(xpu-smi discovery |grep 'DRM Device: /dev/' |sed 's/.*card//;s/[^0-9].*//' |awk '{if($1==0){print $1":"NR - 1}else{print $1 - 1":"NR - 1}}'))
137139
for xpu_id in ${xpu_list[*]}
138140
do
139-
bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu ${xpu_id/:*} static ${#xpu_list[*]} ${xpu_id/*:} &
141+
cpu_list="$(echo "${cores_per_instance} ${xpu_id/*:}" |awk '{printf("%d-%d", $1*$2, $1*$2+$1-1)}')"
142+
numactl --localalloc --physcpubind=${cpu_list} bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu ${xpu_id/:*} static ${#xpu_list[*]} ${xpu_id/*:} &
140143
done
141144
else
142145
for test_model in $(echo ${MODEL_ONLY_NAME} |sed 's/,/ /g')
143146
do
144-
bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu 0 static 1 0 ${test_model}
147+
numactl --localalloc bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu 0 static 1 0 ${test_model}
145148
done
146149
fi
147150
wait

0 commit comments

Comments
 (0)