1
- name : GitHub Actions Demo
2
- run- name : ${{ github.actor }} is testing out GitHub Action
3
- on :
4
- pull_request :
5
- branches : [wenjun/ci]
6
-
7
- concurrency :
8
- group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
- cancel-in-progress : true
10
-
11
-
12
- jobs :
13
- openXLA-DEMO-CI :
14
- runs-on : self-hosted
15
- steps :
16
- - name : Check out repository code
17
- uses : actions/checkout@v3
18
-
19
- - name : Prepare Conda Environment
20
- run : |
21
- set +e
22
- CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
23
- source ${HOME}/miniconda3/bin/activate ${CONDA_ENV }
24
- if [ $? -ne 0 ]; then
25
- echo 'conda env does not exist'
26
- conda create -n ${CONDA_ENV} python=3.10 -y
27
- conda activate ${CONDA_ENV}
28
- fi
29
- pip install jax==0.4.20 jaxlib==0.4.20
30
- pip install numpy
31
- conda install libstdcxx-ng==12.2.0 -c conda-forge
32
- pip install absl-py
33
- pip list | grep numpy
34
- pip list | grep jax
35
-
36
- - name : Build openXLA
37
- run : |
38
- set +e
39
- CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name }}
40
- source ${HOME}/miniconda3/bin/activate ${CONDA_ENV }
41
- which bazel
42
- if [ $? -eq 1 ]; then
43
- wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel-5.3.0-installer-linux-x86_64.sh
44
- bash bazel-5.3.0-installer-linux-x86_64.sh --user
45
- fi
46
- export PATH=$PATH:/home/sdp/bin
47
- source /home/sdp/.bazel/ bin/bazel-complete.bash
48
- bazel --version
49
- pip list | grep numpy
50
- pip install numpy
51
- basekit_path=/home/sdp
52
- complier_path=${ basekit_path}/intel/oneapi/compiler/latest/linux
53
- mkl_path =${basekit_path}/intel/oneapi/mkl /latest
54
- cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp .
55
- ls
56
- python --version
57
- chmod +x ./openXLA_demoxla_auto_configure_mkl.exp
58
- ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path
59
- bazel clean --expunge --async
60
- bazel build //xla/tools/pip_package:build_pip_package
61
- ./ bazel-bin/ xla/tools/pip_package/ build_pip_package ./
62
- build_result=${PIPESTATUS[0]}
63
- echo $ build_result
64
- if [ " $build_result" = "0" ];then
65
- echo "Build successful"
66
- pip install *.whl
67
- else
68
- echo "Build Failed"
69
- exit 1
70
- fi
71
-
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
- # 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
77
- pip install -r /home/sdp/xuming/ test-requirements.txt
78
- basekit_path= /home/sdp
79
- source ${ basekit_path}/intel/oneapi/compiler/latest/env/vars.sh
80
- source ${basekit_path}/intel/oneapi/mkl /latest/env/vars.sh
81
- folder_path="/home/sdp/xuming/ut_4"
82
- # Loop through all Python files in the folder and execute them
83
- dev_num=4 #IDC have 4 1100 pvc card
84
- # Create a pipe and bind the file descriptor 6
85
- tmp_fifofile="/tmp/$$.fifo"
86
- mkfifo $ tmp_fifofile
87
- exec 6<> $tmp_fifofile
88
- rm $tmp_fifofile
89
- # Writing NUM_PROC blank data to the pipe
90
- for ((i = 0; i < $dev_num; i++)); do
91
- echo "$i"
92
- done >&6
93
-
94
- for file in "$folder_path"/*.py; do
95
- # read one data from the pipe
96
- read -u6 id
97
- {
98
- echo "running ut on device-$id"
99
- key=$(basename $file .py)
100
- echo $file
101
- ZE_AFFINITY_MASK="$id" python $file
102
- if [ ${PIPESTATUS[0]} -eq 0 ]; then
103
- echo "run $file successfully"
104
- else
105
- echo "run $test_case failed"
106
- fi
107
- # writing one data to the pipe for the next task
108
- echo $id >&6
109
- } &
110
- done
111
- wait
112
- exec 6>&-
113
-
1
+ =======
2
+ name : GitHub Actions Demo
3
+ run-name : ${{ github.actor }} is testing out GitHub Action
4
+ on :
5
+ pull_request :
6
+ branches : [wenjun/ci]
7
+
8
+ concurrency :
9
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10
+ cancel-in-progress : true
11
+
12
+
13
+ jobs :
14
+ openXLA-DEMO-CI :
15
+ runs-on : self-hosted
16
+ steps :
17
+ - name : Check out repository code
18
+ uses : actions/checkout@v3
19
+
20
+ - name : Prepare Conda Environment
21
+ run : |
22
+ set +e
23
+ CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name } }
24
+ source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
25
+ if [ $? -ne 0 ]; then
26
+ echo ' conda env does not exist'
27
+ conda create -n ${CONDA_ENV} python=3.10 -y
28
+ conda activate ${CONDA_ENV}
29
+ fi
30
+ pip install jax==0.4.20 jaxlib==0.4.20
31
+ pip install numpy
32
+ conda install libstdcxx-ng==12.2.0 -c conda-forge
33
+ pip install absl-py
34
+ pip list | grep numpy
35
+ pip list | grep jax
36
+
37
+ - name : Build openXLA
38
+ run : |
39
+ set +e
40
+ CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name } }
41
+ source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
42
+ which bazel
43
+ if [ $? -eq 1 ]; then
44
+ wget https://github.com/bazelbuild/ bazel/releases/download/5.3.0/bazel -5.3.0-installer-linux-x86_64.sh
45
+ bash bazel-5.3.0-installer-linux-x86_64.sh --user
46
+ fi
47
+ export PATH=$PATH: /home/sdp/bin
48
+ source /home/sdp/.bazel/bin/bazel-complete.bash
49
+ bazel --version
50
+ pip list | grep numpy
51
+ pip install numpy
52
+ basekit_path=/home/sdp
53
+ complier_path =${basekit_path}/intel/oneapi/compiler /latest/linux
54
+ mkl_path=${basekit_path}/intel/oneapi/mkl/latest
55
+ cp /home/sdp/openXLA_demoxla_auto_configure_mkl.exp .
56
+ ls
57
+ python --version
58
+ chmod +x ./openXLA_demoxla_auto_configure_mkl.exp
59
+ ./openXLA_demoxla_auto_configure_mkl.exp $complier_path $mkl_path
60
+ bazel clean --expunge --async
61
+ bazel build // xla/tools/pip_package: build_pip_package
62
+ ./bazel-bin/xla/tools/pip_package/build_pip_package ./
63
+ build_result=${PIPESTATUS[0]}
64
+ echo $build_result
65
+ if [ "$build_result" = "0" ];then
66
+ echo "Build successful"
67
+ pip install *.whl
68
+ else
69
+ echo "Build Failed"
70
+ exit 1
71
+ fi
72
+
73
+ - name : UT testing
74
+ run : |
75
+ CONDA_ENV=openxla_preCI_${{ github.event.pull_request.number }}_${{ runner.name } }
76
+ source ${HOME}/miniconda3/bin/activate ${CONDA_ENV}
77
+ # 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
78
+ pip install -r /home/sdp/xuming/test-requirements.txt
79
+ basekit_path=/home/sdp
80
+ source ${basekit_path}/intel/oneapi/compiler /latest/env/vars.sh
81
+ source ${basekit_path}/intel/oneapi/mkl/latest/env/vars.sh
82
+ folder_path="/home/sdp/xuming/ut_4"
83
+ # Loop through all Python files in the folder and execute them
84
+ dev_num=4 #IDC have 4 1100 pvc card
85
+ # Create a pipe and bind the file descriptor 6
86
+ tmp_fifofile="/tmp/$$.fifo"
87
+ mkfifo $tmp_fifofile
88
+ exec 6<> $tmp_fifofile
89
+ rm $tmp_fifofile
90
+ # Writing NUM_PROC blank data to the pipe
91
+ for ((i = 0; i < $dev_num; i++)); do
92
+ echo "$i"
93
+ done >&6
94
+
95
+ for file in "$folder_path"/*.py; do
96
+ # read one data from the pipe
97
+ read -u6 id
98
+ {
99
+ echo "running ut on device-$id"
100
+ key=$(basename $file .py)
101
+ echo $file
102
+ ZE_AFFINITY_MASK="$id" python $file
103
+ if [ ${PIPESTATUS[0]} -eq 0 ]; then
104
+ echo "run $file successfully"
105
+ else
106
+ echo "run $test_case failed"
107
+ fi
108
+ # writing one data to the pipe for the next task
109
+ echo $id >&6
110
+ } &
111
+ done
112
+ wait
113
+ exec 6>&-
0 commit comments