Skip to content

Xetile generator

Xetile generator #2

Workflow file for this run

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
# /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