Skip to content

Commit

Permalink
Merge branch 'wenjun/ci' into validation2
Browse files Browse the repository at this point in the history
  • Loading branch information
wendyliu235 authored Nov 23, 2023
2 parents c44df60 + 6b88c03 commit 0eaa1fa
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,46 @@ jobs:
# echo "Build Failed"
# exit 1
# fi
- name: UT testing
run: |
CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
basekit_path=/home/sdp
source ${basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
folder_path="/home/sdp/xuming/ut"
pip install absl-py
# Loop through all Python files in the folder and execute them
dev_num=4 #IDC have 4 1100 pvc card
# Create a pipe and bind the file descriptor 6
tmp_fifofile="/tmp/$$.fifo"
mkfifo $tmp_fifofile
exec 6<>$tmp_fifofile
rm $tmp_fifofile
# Writing NUM_PROC blank data to the pipe
for ((i = 0; i < $dev_num; i++)); do
echo "$i"
done >&6
- name: UT testing
run: |
CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
basekit_path=/home/sdp
source ${basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
folder_path="/home/sdp/xuming/ut"
pip install absl-py
# Loop through all Python files in the folder and execute them
dev_num=4 #IDC have 4 1100 pvc card
# Create a pipe and bind the file descriptor 6
tmp_fifofile="/tmp/$$.fifo"
mkfifo $tmp_fifofile
exec 6<>$tmp_fifofile
rm $tmp_fifofile
# Writing NUM_PROC blank data to the pipe
for ((i = 0; i < $dev_num; i++)); do
echo "$i"
done >&6
for file in "$folder_path"/*.py; do
# read one data from the pipe
read -u6 id
{
echo "running ut on device-$id"
key=$(basename $file .py)
echo $file
ZE_AFFINITY_MASK="$id" python $file
if [ ${PIPESTATUS[0]} -eq 0 ]; then
echo "run $file successfully"
else
echo "run $test_case failed"
fi
# writing one data to the pipe for the next task
echo $id >&6
} &
done
wait
exec 6>&-
for file in $folder_path/*.py; do
# read one data from the pipe
read -u6 id
Expand Down

0 comments on commit 0eaa1fa

Please sign in to comment.