@@ -69,27 +69,46 @@ jobs:
69
69
# echo "Build Failed"
70
70
# exit 1
71
71
# 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
92
92
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>&-
93
112
for file in $folder_path/*.py; do
94
113
# read one data from the pipe
95
114
read -u6 id
0 commit comments