-
Notifications
You must be signed in to change notification settings - Fork 45
104 lines (90 loc) · 4.41 KB
/
build_gpu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: GPU Build
on:
pull_request:
branches:
- main
- upstream
- 'dist-ndarray'
workflow_dispatch:
workflow_call:
jobs:
build:
if: github.repository == 'intel-innersource/frameworks.ai.mlir.mlir-extensions'
runs-on: [self-hosted, pvc, glados]
timeout-minutes: 450
env:
TBB_VER: 2021.6.0
LEVEL_ZERO_VER: v1.8.1
TBB_URL_PREFIX: https://github.com/oneapi-src/oneTBB/releases/download/
LLVM_SHA_FILE: llvm_version.txt
steps:
- name: Check build root
run: |
export BUILD_ROOT=$(pwd)/build_gpu
echo BUILD_ROOT=${BUILD_ROOT} >> $GITHUB_ENV
export HOME_DIR=${BUILD_ROOT}/home
echo HOME_DIR=${HOME_DIR} >> $GITHUB_ENV
if [ ! -d "$BUILD_ROOT" ]; then mkdir -p $BUILD_ROOT; fi
- name: Clear home dir
run: |
mkdir -p $HOME_DIR
cd $HOME_DIR
rm -rf *
- uses: actions/checkout@v4
with:
repository: intel-innersource/frameworks.ai.mlir.mlir-extensions
token: ${{ secrets.WORKFLOW_TOKEN }}
fetch-depth: 0
path: ${{ env.HOME_DIR }}/frameworks.ai.mlir.mlir-extensions
- name: Setup Level Zero
shell: bash -le {0}
run: |
cd $HOME_DIR
git clone https://github.com/oneapi-src/level-zero.git
cd level-zero
git checkout $LEVEL_ZERO_VER
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../level-zero-install
cmake --build build --target install
- name: Checkout MLIR
run: |
cd $BUILD_ROOT
if [ ! -d "llvm-project" ]; then git clone https://github.com/llvm/llvm-project; fi
cd $BUILD_ROOT/llvm-project
git reset --hard HEAD
export LLVM_SHA=`cat $HOME_DIR/frameworks.ai.mlir.mlir-extensions/build_tools/llvm_version.txt`
git fetch --prune
git checkout $LLVM_SHA || exit 1
if [ -d "$HOME_DIR/frameworks.ai.mlir.mlir-extensions/build_tools/patches" ]; then git apply $HOME_DIR/frameworks.ai.mlir.mlir-extensions/build_tools/patches/*.patch; fi
- name: Setup IMEX and run tests
run: |
source /opt/intel/oneapi/setvars.sh
cd $HOME_DIR/frameworks.ai.mlir.mlir-extensions
pip install psutil
cmake -S $BUILD_ROOT/llvm-project/llvm -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_ZSTD=OFF -DLLVM_EXTERNAL_PROJECTS="Imex" -DLLVM_EXTERNAL_IMEX_SOURCE_DIR=. -DIMEX_ENABLE_SYCL_RUNTIME=1 -DIMEX_ENABLE_L0_RUNTIME=1 -DLEVEL_ZERO_DIR=$HOME_DIR/level-zero-install/ -DLLVM_LIT_ARGS="-a -j 4 --debug --timeout=1800" -DIMEX_ENABLE_PVC_TARGET=1
set -o pipefail
cmake --build build --target check-imex | tee build/tests.txt
- name: Run SG-level XeTile generated cases
run: |
rm -rf $HOME_DIR/frameworks.ai.mlir.mlir-extensions/scripts/xetile-test-gen/GEMM_reports
rm -rf $HOME_DIR/frameworks.ai.mlir.mlir-extensions/scripts/xetile-test-gen/Generated_GEMM
cd $HOME_DIR/frameworks.ai.mlir.mlir-extensions/scripts/xetile-test-gen
pip install pandas
pip install argparse
pip install openpyxl
./run_tests.sh --gen_default_cases=1 --validate=1 --verbose=1 --llvm_build_dir=../../build
# /home/gta/anaconda3/envs/imex-dev/bin/python $HOME_DIR/mlir-extensions/build/bin/imex-runner.py -i $HOME_DIR/mlir-extensions/test/Integration/Dialect/Linalg/OpenCL/linalg_addf.mlir -e main --pass-pipeline-file=$HOME_DIR/mlir-extensions/test/Integration/Dialect/Linalg/OpenCL/linalg-to-gpux-opencl.pp -entry-point-result=void --shared-libs=$HOME_DIR/llvm-mlir/_mlir_install/lib/libmlir_runner_utils.so,$HOME_DIR/mlir-extensions/build/lib/liblevel-zero-runtime.so
#- name: Run perf script
# run: |
# cd ${{ env.HOME_DIR }}/mlir-extensions/scripts
# ./run_perf_test.sh
- name: Upload tests.txt
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: tests_gpu.txt
path: ${{ env.HOME_DIR }}/frameworks.ai.mlir.mlir-extensions/build/tests.txt
#- name: Upload report.txt
# uses: actions/upload-artifact@v2
#with:
#name: report.txt
#path: ${{ env.HOME_DIR }}/frameworks.ai.mlir.mlir-extensions/scripts/report.txt