Skip to content

Jax master is testing out GitHub Action #30

Jax master is testing out GitHub Action

Jax master is testing out GitHub Action #30

Workflow file for this run

name: Public Jax CI
run-name: Jax master is testing out GitHub Action
on:
push:
branches:
- wenjun/jax
workflow_dispatch:
inputs:
jax_commit:
description: 'Specify the commit hash'
default: 'master'
jobs:
JAX-CI:
runs-on: Intel_openxla
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Prepare Conda Environment
run: |
set +e
CONDA_ENV=jax_preCI_patch_${{ runner.name }}
source /opt/miniconda/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
sudo apt install g++ python python3-dev -y | true
pip uninstall jax jaxlib -y
pip install numpy wheel build
conda install -c conda-forge libstdcxx-ng=12.1.0
#This CI is for public jax
#git clone https://github.com/google/jax.git && cd jax && git checkout ${{ inputs.gha_runner }}
git clone -b yang/runtime https://github.com/Intel-tensorflow/xla yang_xla
git clone https://github.com/google/jax.git && cd jax && git checkout ceb198582b62b9e6f6bdf20ab74839b0cf1db16e
git apply ../test/jax.patch
pip install -r ./build/test-requirements.txt
- name: Build Jax
run: |
set +e
CONDA_ENV=jax_preCI_patch_${{ runner.name }}
source /opt/miniconda/bin/activate ${CONDA_ENV}
#build jax
cd jax
#python build/build.py #CPU
basekit_path=/home/sdp
export SYCL_TOOLKIT_PATH=${basekit_path}/intel/oneapi/compiler/latest
current_path=$(pwd)
parent_path=$(dirname "$current_path")
python build/build.py --enable_sycl --bazel_options=--override_repository=xla=$parent_path/yang_xla
build_result=${PIPESTATUS[0]}
echo $build_result
if [ "$build_result" = "0" ];then
echo "Build successful"
#pip install tests/*.whl #cpu
pip install -e . && pip install dist/*.whl
else
echo "Build Failed"
exit 1
fi
- name: UT testing
run: |
set +e
CONDA_ENV=jax_preCI_patch_${{ runner.name }}
source /opt/miniconda/bin/activate ${CONDA_ENV}
conda install libstdcxx-ng==12.2.0 -c conda-forge -y
basekit_path=/home/sdp
source ${basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
cd ~/actions-runner/workspace_openxla/intel-extension-for-openxla/intel-extension-for-openxla/jax
commit_hash=$(git rev-parse --short HEAD)
mkdir -p ./logs/ut
echo "$commit_hash" |& tee ./logs/ut/$commit_hash.txt
find ./tests -name "*.py" | sed 's#\./##g' |& tee ut_list.txt
# Check if the file exists
file_path=./ut_list.txt
if [ -f "$file_path" ]; then
# Read each line using a while loop
while IFS= read -r line; do
echo "Processing line: $line"
log_name=$(basename "$line" .py)
python $line |& tee ./logs/ut/$log_name.log
if [ ${PIPESTATUS[0]} -eq 0 ]; then
echo "$line" >> ./logs/ut/successful.log
else
echo "$line" >> ./logs/ut/err.log
fi
done < "$file_path" # Close the while loop properly
else
echo "File not found: $file_path"
exit
fi
- name: Upload CI Data
uses: actions/upload-artifact@v3
with:
name: JAX-CI-Data
path: ~/actions-runner/workspace_openxla/intel-extension-for-openxla/intel-extension-for-openxla/jax/logs
- name: Test Results Check
run: |
cd ~/actions-runner/workspace_openxla/intel-extension-for-openxla/intel-extension-for-openxla/jax
#UT results check
if [ -f "./logs/ut/err.log" ]; then
echo "exist fail cases"
cat ./logs/ut/err.log
exit 1
else
echo "run successful"
fi