Skip to content

[CI] Add PVC github runner #1087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions: read-all
jobs:
build_linux:
name: Builds IMEX on Linux
runs-on: ubuntu-22.04
runs-on: cpu
defaults:
run:
shell: bash -l -eo pipefail {0}
Expand All @@ -31,6 +31,7 @@ jobs:
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
auto-update-conda: true
python-version: ${{ matrix.python }}
activate-environment: imex-devel
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/build_gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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}

strategy:
matrix:
python: [3.9]

steps:
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
auto-update-conda: true
python-version: ${{ matrix.python }}
activate-environment: imex-devel

- name: Conda info
run: conda info

- name: Install Build tools
run: |
conda install cmake ninja conda-forge::lit conda-forge::doxygen
conda list

- 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: 3 # 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
source /opt/intel/oneapi/setvars.sh


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
pip install psutil
./scripts/compile.sh -DLLVM_EXTERNAL_LIT=$(which lit) -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
11 changes: 11 additions & 0 deletions test/PlaidML/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,16 @@ local_excludes = [
'OpTest.GEMV_FLOAT32.mlir',
'OpTest.Shape.mlir'
]

non_pvc_tests = [
'CppEdsl.Convolution_BF16.mlir',
'OpTest.BroadcastNonNumpy_BF16.mlir',
'OpTest.Relu_BF16.mlir',
'OpTest.Transpose_BF16.mlir',
]

if(config.imex_enable_pvc_target or config.imex_enable_bmg_target):
config.excludes.update(non_pvc_tests)

if(not config.imex_enable_excluded_tests):
config.excludes.update(local_excludes)
Loading