diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4867fcb8e..df4c413cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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} @@ -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 diff --git a/.github/workflows/build_gpu.yml b/.github/workflows/build_gpu.yml new file mode 100644 index 000000000..07f27f033 --- /dev/null +++ b/.github/workflows/build_gpu.yml @@ -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 diff --git a/test/PlaidML/lit.local.cfg b/test/PlaidML/lit.local.cfg index 521d62516..4fed4aac9 100644 --- a/test/PlaidML/lit.local.cfg +++ b/test/PlaidML/lit.local.cfg @@ -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)