Skip to content

Commit 0eaa1fa

Browse files
authored
Merge branch 'wenjun/ci' into validation2
2 parents c44df60 + 6b88c03 commit 0eaa1fa

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

.github/workflows/demo.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,46 @@ jobs:
6969
# echo "Build Failed"
7070
# exit 1
7171
# fi
72-
- name: UT testing
73-
run: |
74-
CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
75-
source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
76-
basekit_path=/home/sdp
77-
source ${basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
78-
source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
79-
folder_path="/home/sdp/xuming/ut"
80-
pip install absl-py
81-
# Loop through all Python files in the folder and execute them
82-
dev_num=4 #IDC have 4 1100 pvc card
83-
# Create a pipe and bind the file descriptor 6
84-
tmp_fifofile="/tmp/$$.fifo"
85-
mkfifo $tmp_fifofile
86-
exec 6<>$tmp_fifofile
87-
rm $tmp_fifofile
88-
# Writing NUM_PROC blank data to the pipe
89-
for ((i = 0; i < $dev_num; i++)); do
90-
echo "$i"
91-
done >&6
72+
- name: UT testing
73+
run: |
74+
CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
75+
source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
76+
basekit_path=/home/sdp
77+
source ${basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
78+
source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
79+
folder_path="/home/sdp/xuming/ut"
80+
pip install absl-py
81+
# Loop through all Python files in the folder and execute them
82+
dev_num=4 #IDC have 4 1100 pvc card
83+
# Create a pipe and bind the file descriptor 6
84+
tmp_fifofile="/tmp/$$.fifo"
85+
mkfifo $tmp_fifofile
86+
exec 6<>$tmp_fifofile
87+
rm $tmp_fifofile
88+
# Writing NUM_PROC blank data to the pipe
89+
for ((i = 0; i < $dev_num; i++)); do
90+
echo "$i"
91+
done >&6
9292
93+
for file in "$folder_path"/*.py; do
94+
# read one data from the pipe
95+
read -u6 id
96+
{
97+
echo "running ut on device-$id"
98+
key=$(basename $file .py)
99+
echo $file
100+
ZE_AFFINITY_MASK="$id" python $file
101+
if [ ${PIPESTATUS[0]} -eq 0 ]; then
102+
echo "run $file successfully"
103+
else
104+
echo "run $test_case failed"
105+
fi
106+
# writing one data to the pipe for the next task
107+
echo $id >&6
108+
} &
109+
done
110+
wait
111+
exec 6>&-
93112
for file in $folder_path/*.py; do
94113
# read one data from the pipe
95114
read -u6 id

0 commit comments

Comments
 (0)