Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation2 #13

Merged
merged 21 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 113 additions & 113 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,113 @@
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.20 jaxlib==0.4.20
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}
# install requirement from https://github.com/intel-innersource/frameworks.ai.infrastructure.intel-extension-for-tensorflow.jax/blob/yang/jax-v0.4.20/build/test-requirements.txt
pip install -r /home/sdp/xuming/test-requirements.txt
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_4"
# 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>&-

=======
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.20 jaxlib==0.4.20
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}
# install requirement from https://github.com/intel-innersource/frameworks.ai.infrastructure.intel-extension-for-tensorflow.jax/blob/yang/jax-v0.4.20/build/test-requirements.txt
pip install -r /home/sdp/xuming/test-requirements.txt
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_4"
# 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>&-
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import subprocess
import sys



# pylint: disable=g-import-not-at-top
try:
from shutil import which
Expand Down