[CI] Add PVC github runner #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GPU Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: read-all | |
jobs: | |
build_linux: | |
name: Builds IMEX on Linux | |
runs-on: pvc | |
defaults: | |
run: | |
shell: bash -l -eo pipefail {0} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Cache Vars | |
run: | | |
echo LLVM_SHA=$(cat build_tools/llvm_version.txt) | tee -a $GITHUB_ENV | |
- name: Cache LLLVM-MLIR | |
id: cache-llvm-mlir | |
uses: actions/cache@v4 | |
env: | |
LLVM_CACHE_NUMBER: 2 # Increase to reset cache | |
with: | |
path: | | |
${{ github.workspace }}/mlir | |
key: ${{ runner.os }}-build-llvm-${{ env.LLVM_CACHE_NUMBER }}-${{ env.LLVM_SHA }} | |
- name: Build LLVM-MLIR | |
if: steps.cache-llvm-mlir.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/llvm/llvm-project --branch main --single-branch | |
cd llvm-project | |
git checkout $LLVM_SHA | |
git apply ../build_tools/patches/*.patch | |
echo "INFO: Need to rebuild LLVM-MLIR. Previous installation for MLIR not found" | |
cmake -G Ninja -B build -S llvm \ | |
-DCMAKE_BUILD_TYPE=MinSizeRel \ | |
-DLLVM_ENABLE_PROJECTS=mlir \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DLLVM_USE_LINKER=gold \ | |
-DLLVM_INSTALL_UTILS=ON \ | |
-DLLVM_TARGETS_TO_BUILD="X86;SPIRV" \ | |
-DLLVM_ENABLE_BINDINGS=OFF \ | |
-DLLVM_ENABLE_ZSTD=OFF \ | |
-DMLIR_ENABLE_SYCL_RUNNER=1 \ | |
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/mlir | |
cmake --build build --target install | |
- name: Build IMEX and run lit tests | |
shell: bash -le {0} | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
./scripts/compile.sh -DLLVM_LIT_ARGS="-a" -DMLIR_DIR=${{ github.workspace }}/mlir/lib/cmake/mlir -DIMEX_ENABLE_PVC_TARGET=1 -DIMEX_ENABLE_SYCL_RUNTIME=1 -DIMEX_ENABLE_L0_RUNTIME=1 -DLLVM_LIT_ARGS="-a -j 4 --debug --timeout=1800" -DMLIR_ENABLE_SYCL_RUNNER=1 | |
cmake --build build --target check-imex | tee build/tests.txt | |
- name: Upload tests.txt | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tests_gpu.txt | |
path: build/tests.txt |