From 0026bf336d4bf49e2a36c6dce7f8ae13944d8c04 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Mon, 20 Nov 2023 14:17:28 +0800 Subject: [PATCH 01/16] check ci --- .github/workflows/demo.yml | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/demo.yml diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 0000000..4e1a433 --- /dev/null +++ b/.github/workflows/demo.yml @@ -0,0 +1,94 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Action +on: + pull_request: + branches: + - wenjun/ci + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + +jobs: + openXLA-DEMO-CI: + runs-on: self-hosted + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Prepare Conda Environment + run: | + set +e + CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} + source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} + if [ $? -ne 0 ]; then + echo 'conda env does not exist' + conda create -n ${CONDA_ENV} python=3.10 -y + conda activate ${CONDA_ENV} + fi + pip install jax==0.4.13 jaxlib==0.4.13 + pip install numpy + conda install libstdcxx-ng==12.2.0 -c conda-forge + pip install absl-py + pip list | grep numpy + pip list | grep jax + + - name: Build openXLA + run: | + set +e + CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} + source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} + which bazel + if [ $? -eq 1 ]; then + wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh + bash bazel-5.3.0-installer-linux-x86_64.sh --user + fi + export PATH=$PATH:/home/sdp/bin + source /home/sdp/.bazel/bin/bazel-complete.bash + bazel --version + pip list | grep numpy + pip install numpy + basekit_path=/home/sdp + complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + mkl_path=${basekit_path}/intel/oneapi/mkl/latest + cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . + ls + python --version + chmod +x ./openXLA_demoxla_auto_configure_mkl.exp + ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path + bazel clean --expunge --async + bazel build //xla/tools/pip_package:build_pip_package + ./bazel-bin/xla/tools/pip_package/build_pip_package ./ + build_result=${PIPESTATUS[0]} + echo $build_result + if [ "$build_result" = "0" ];then + echo "Build successful" + pip install *.whl + else + 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 +# for file in "$folder_path"/*.py; do +# echo $file +# if [ -f "$file" ]; then +# echo "Running $file..." +# python "$file" +# if [ ${PIPESTATUS[0]} -eq 0 ]; then +# echo "run $test_case successfully" +# else +# echo "run $test_case failed" +# fi +# echo "----------------------------------------" +# fi +# done From f9ab4d65a603ee13ad5fce85dcc1ae68923f8bca Mon Sep 17 00:00:00 2001 From: wendyliu235 Date: Mon, 20 Nov 2023 14:29:39 +0800 Subject: [PATCH 02/16] Update demo.yml --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 4e1a433..5ea186c 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -50,7 +50,7 @@ jobs: pip list | grep numpy pip install numpy basekit_path=/home/sdp - complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + complier_path=${basekit_path}/intel/oneapi/compiler/latest mkl_path=${basekit_path}/intel/oneapi/mkl/latest cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . ls From 230345cc07634491ca0a32ee0fcf209c211fd7b4 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 16:19:50 +0800 Subject: [PATCH 03/16] 1 --- .github/workflows/demo.yml | 74 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 7c11e4f..d0d3599 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -69,41 +69,41 @@ 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 \ No newline at end of file + 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 \ No newline at end of file From 5d67fe3dbd33a5819eeb045a420e7a398d02cbb5 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 16:26:57 +0800 Subject: [PATCH 04/16] 1 --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index d0d3599..1caa637 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -97,7 +97,7 @@ jobs: echo "running ut on device-$id" key=$(basename $file .py) echo $file - ZE_AFFINITY_MASK="$id" python $file + ZE_AFFINITY_MASK="$id" python $file |$ tee $file.log if [ ${PIPESTATUS[0]} -eq 0 ]; then echo "run $file successfully" else From 49ec3c55ffe2086a5d861a17796d56de05ba7921 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 16:29:37 +0800 Subject: [PATCH 05/16] 1 --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 1caa637..326ba05 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -97,7 +97,7 @@ jobs: echo "running ut on device-$id" key=$(basename $file .py) echo $file - ZE_AFFINITY_MASK="$id" python $file |$ tee $file.log + ZE_AFFINITY_MASK="$id" python $file |& tee $file.log if [ ${PIPESTATUS[0]} -eq 0 ]; then echo "run $file successfully" else From e1967ee093f866f6416c0ee5421133a566dee965 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 17:55:52 +0800 Subject: [PATCH 06/16] 1 --- .github/workflows/demo.yml | 74 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 326ba05..22c0534 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -34,41 +34,41 @@ jobs: pip list | grep numpy pip list | grep jax - # - name: Build openXLA - # run: | - # set +e - # CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} - # source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} - # which bazel - # if [ $? -eq 1 ]; then - # wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh - # bash bazel-5.3.0-installer-linux-x86_64.sh --user - # fi - # export PATH=$PATH:/home/sdp/bin - # source /home/sdp/.bazel/bin/bazel-complete.bash - # bazel --version - # pip list | grep numpy - # pip install numpy - # basekit_path=/home/sdp - # complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux - # mkl_path=${basekit_path}/intel/oneapi/mkl/latest - # cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . - # ls - # python --version - # chmod +x ./openXLA_demoxla_auto_configure_mkl.exp - # ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path - # bazel clean --expunge --async - # bazel build //xla/tools/pip_package:build_pip_package - # ./bazel-bin/xla/tools/pip_package/build_pip_package ./ - # build_result=${PIPESTATUS[0]} - # echo $build_result - # if [ "$build_result" = "0" ];then - # echo "Build successful" - # pip install *.whl - # else - # echo "Build Failed" - # exit 1 - # fi + - name: Build openXLA + run: | + set +e + CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} + source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} + which bazel + if [ $? -eq 1 ]; then + wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh + bash bazel-5.3.0-installer-linux-x86_64.sh --user + fi + export PATH=$PATH:/home/sdp/bin + source /home/sdp/.bazel/bin/bazel-complete.bash + bazel --version + pip list | grep numpy + pip install numpy + basekit_path=/home/sdp + complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + mkl_path=${basekit_path}/intel/oneapi/mkl/latest + cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . + ls + python --version + chmod +x ./openXLA_demoxla_auto_configure_mkl.exp + ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path + bazel clean --expunge --async + bazel build //xla/tools/pip_package:build_pip_package + ./bazel-bin/xla/tools/pip_package/build_pip_package ./ + build_result=${PIPESTATUS[0]} + echo $build_result + if [ "$build_result" = "0" ];then + echo "Build successful" + pip install *.whl + else + echo "Build Failed" + exit 1 + fi - name: UT testing run: | CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} @@ -90,14 +90,14 @@ jobs: echo "$i" done >&6 - for file in "$folder_path"/*.py; do + find "$folder_path" -type f -name '*.py' | while read -r file; 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 |& tee $file.log + ZE_AFFINITY_MASK="$id" python $file |& tee ../logs/$file.log if [ ${PIPESTATUS[0]} -eq 0 ]; then echo "run $file successfully" else From 778d3c26e91ecf452acf56cf276604fb48990b59 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 18:01:01 +0800 Subject: [PATCH 07/16] fix compiler path issue --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 22c0534..7c697f6 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -50,7 +50,7 @@ jobs: pip list | grep numpy pip install numpy basekit_path=/home/sdp - complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + complier_path=${basekit_path}/intel/oneapi/compiler/latest mkl_path=${basekit_path}/intel/oneapi/mkl/latest cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . ls From c565dde1cc28875bb1a8a50fc3bb4926a192f50c Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Wed, 22 Nov 2023 19:58:21 +0800 Subject: [PATCH 08/16] 1 --- .github/workflows/demo.yml | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 7c697f6..bbf5f57 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -34,41 +34,41 @@ jobs: pip list | grep numpy pip list | grep jax - - name: Build openXLA - run: | - set +e - CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} - source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} - which bazel - if [ $? -eq 1 ]; then - wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh - bash bazel-5.3.0-installer-linux-x86_64.sh --user - fi - export PATH=$PATH:/home/sdp/bin - source /home/sdp/.bazel/bin/bazel-complete.bash - bazel --version - pip list | grep numpy - pip install numpy - basekit_path=/home/sdp - complier_path=${basekit_path}/intel/oneapi/compiler/latest - mkl_path=${basekit_path}/intel/oneapi/mkl/latest - cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . - ls - python --version - chmod +x ./openXLA_demoxla_auto_configure_mkl.exp - ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path - bazel clean --expunge --async - bazel build //xla/tools/pip_package:build_pip_package - ./bazel-bin/xla/tools/pip_package/build_pip_package ./ - build_result=${PIPESTATUS[0]} - echo $build_result - if [ "$build_result" = "0" ];then - echo "Build successful" - pip install *.whl - else - echo "Build Failed" - exit 1 - fi + # - name: Build openXLA + # run: | + # set +e + # CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} + # source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} + # which bazel + # if [ $? -eq 1 ]; then + # wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh + # bash bazel-5.3.0-installer-linux-x86_64.sh --user + # fi + # export PATH=$PATH:/home/sdp/bin + # source /home/sdp/.bazel/bin/bazel-complete.bash + # bazel --version + # pip list | grep numpy + # pip install numpy + # basekit_path=/home/sdp + # complier_path=${basekit_path}/intel/oneapi/compiler/latest + # mkl_path=${basekit_path}/intel/oneapi/mkl/latest + # cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . + # ls + # python --version + # chmod +x ./openXLA_demoxla_auto_configure_mkl.exp + # ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path + # bazel clean --expunge --async + # bazel build //xla/tools/pip_package:build_pip_package + # ./bazel-bin/xla/tools/pip_package/build_pip_package ./ + # build_result=${PIPESTATUS[0]} + # echo $build_result + # if [ "$build_result" = "0" ];then + # echo "Build successful" + # pip install *.whl + # else + # echo "Build Failed" + # exit 1 + # fi - name: UT testing run: | CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} @@ -97,7 +97,7 @@ jobs: echo "running ut on device-$id" key=$(basename $file .py) echo $file - ZE_AFFINITY_MASK="$id" python $file |& tee ../logs/$file.log + ZE_AFFINITY_MASK="$id" python $file if [ ${PIPESTATUS[0]} -eq 0 ]; then echo "run $file successfully" else From 0a78e1f8cddda2952a26fa29a90d29765790e500 Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Thu, 23 Nov 2023 08:48:24 +0800 Subject: [PATCH 09/16] 1 --- .github/workflows/demo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index bbf5f57..8139ba5 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -90,7 +90,7 @@ jobs: echo "$i" done >&6 - find "$folder_path" -type f -name '*.py' | while read -r file; do + for file in ./ut/*.py; do # read one data from the pipe read -u6 id { @@ -101,7 +101,7 @@ jobs: if [ ${PIPESTATUS[0]} -eq 0 ]; then echo "run $file successfully" else - echo "run $test_case failed" + echo "run $file failed" fi # writing one data to the pipe for the next task echo $id >&6 From e1966e296f06217155b0147684cfdb5a78e8dadc Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Thu, 23 Nov 2023 08:49:01 +0800 Subject: [PATCH 10/16] 1 --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 8139ba5..e10ad04 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -90,7 +90,7 @@ jobs: echo "$i" done >&6 - for file in ./ut/*.py; do + for file in $folder_path/*.py; do # read one data from the pipe read -u6 id { From bf775fe72dded1bfe2fd3fbc66a9ce715a0d9b7d Mon Sep 17 00:00:00 2001 From: "Liu, Wenjun" Date: Thu, 23 Nov 2023 09:21:48 +0800 Subject: [PATCH 11/16] 1 --- .github/workflows/demo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index e10ad04..ee4fb29 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -102,6 +102,7 @@ jobs: echo "run $file successfully" else echo "run $file failed" + exit 1 fi # writing one data to the pipe for the next task echo $id >&6 From c44df6009e8062376d91524427703570201936fb Mon Sep 17 00:00:00 2001 From: wendyliu235 Date: Thu, 23 Nov 2023 12:29:44 +0800 Subject: [PATCH 12/16] Update demo.yml --- .github/workflows/demo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index ee4fb29..c63b1ad 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -102,9 +102,8 @@ jobs: echo "run $file successfully" else echo "run $file failed" - exit 1 fi # writing one data to the pipe for the next task echo $id >&6 } & - done \ No newline at end of file + done From 6bb5992b862e9281fd4e1b4f0aaee8b0ddb2b38f Mon Sep 17 00:00:00 2001 From: wendyliu235 Date: Thu, 23 Nov 2023 15:56:58 +0800 Subject: [PATCH 13/16] Update demo.yml --- .github/workflows/demo.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 280325d..79eb79e 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -109,20 +109,4 @@ jobs: done wait exec 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 $file failed" - fi - # writing one data to the pipe for the next task - echo $id >&6 - } & - done + From 85afde8487e521c05335caeb327b08e537735460 Mon Sep 17 00:00:00 2001 From: wendyliu235 Date: Thu, 23 Nov 2023 16:01:23 +0800 Subject: [PATCH 14/16] Update demo.yml --- .github/workflows/demo.yml | 150 ++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 79eb79e..3afc52e 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -34,79 +34,79 @@ jobs: pip list | grep numpy pip list | grep jax - # - name: Build openXLA - # run: | - # set +e - # CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} - # source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} - # which bazel - # if [ $? -eq 1 ]; then - # wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh - # bash bazel-5.3.0-installer-linux-x86_64.sh --user - # fi - # export PATH=$PATH:/home/sdp/bin - # source /home/sdp/.bazel/bin/bazel-complete.bash - # bazel --version - # pip list | grep numpy - # pip install numpy - # basekit_path=/home/sdp - # complier_path=${basekit_path}/intel/oneapi/compiler/latest - # mkl_path=${basekit_path}/intel/oneapi/mkl/latest - # cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . - # ls - # python --version - # chmod +x ./openXLA_demoxla_auto_configure_mkl.exp - # ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path - # bazel clean --expunge --async - # bazel build //xla/tools/pip_package:build_pip_package - # ./bazel-bin/xla/tools/pip_package/build_pip_package ./ - # build_result=${PIPESTATUS[0]} - # echo $build_result - # if [ "$build_result" = "0" ];then - # echo "Build successful" - # pip install *.whl - # else - # 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: Build openXLA + run: | + set +e + CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }} + source ${HOME}/miniconda3/bin/activate ${CONDA_ENV} + which bazel + if [ $? -eq 1 ]; then + wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh + bash bazel-5.3.0-installer-linux-x86_64.sh --user + fi + export PATH=$PATH:/home/sdp/bin + source /home/sdp/.bazel/bin/bazel-complete.bash + bazel --version + pip list | grep numpy + pip install numpy + basekit_path=/home/sdp + complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + mkl_path=${basekit_path}/intel/oneapi/mkl/latest + cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . + ls + python --version + chmod +x ./openXLA_demoxla_auto_configure_mkl.exp + ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path + bazel clean --expunge --async + bazel build //xla/tools/pip_package:build_pip_package + ./bazel-bin/xla/tools/pip_package/build_pip_package ./ + build_result=${PIPESTATUS[0]} + echo $build_result + if [ "$build_result" = "0" ];then + echo "Build successful" + pip install *.whl + else + 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 + + 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 - { - 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>&- - From 588dc33b2d8da96e04b88aa1493b78fff5eeb6ee Mon Sep 17 00:00:00 2001 From: wendyliu235 Date: Thu, 23 Nov 2023 16:12:28 +0800 Subject: [PATCH 15/16] Update demo.yml --- .github/workflows/demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 3afc52e..593dea7 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -50,7 +50,7 @@ jobs: pip list | grep numpy pip install numpy basekit_path=/home/sdp - complier_path=${basekit_path}/intel/oneapi/compiler/latest/linux + complier_path=${basekit_path}/intel/oneapi/compiler/latest mkl_path=${basekit_path}/intel/oneapi/mkl/latest cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp . ls From 0ad33d2d0ec2a92c64ba5a87f454fb1efebd49b4 Mon Sep 17 00:00:00 2001 From: XumingGai <108659240+XumingGai@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:11:45 +0800 Subject: [PATCH 16/16] Update configure.py --- configure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.py b/configure.py index bdd27fe..b426590 100644 --- a/configure.py +++ b/configure.py @@ -27,6 +27,8 @@ import subprocess import sys + + # pylint: disable=g-import-not-at-top try: from shutil import which