From b696362b7d2a5ab1a6c2ea8d93ff452c9ea473e3 Mon Sep 17 00:00:00 2001 From: Sambhav Jain Date: Tue, 9 Aug 2022 12:13:16 -0700 Subject: [PATCH] Enable OOT builds in CI (#1188) --- .github/workflows/buildAndTest.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/buildAndTest.yml b/.github/workflows/buildAndTest.yml index 94cf6343e..289f6c9bf 100644 --- a/.github/workflows/buildAndTest.yml +++ b/.github/workflows/buildAndTest.yml @@ -36,7 +36,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Get torch-mlir + - name: Checkout torch-mlir uses: actions/checkout@v2 with: submodules: 'true' @@ -44,13 +44,13 @@ jobs: with: cache-suffix: ${{ matrix.os }}-${{ matrix.targetarch }}-${{ matrix.llvmtype }}-${{ matrix.llvmbuildtype }} - - name: llvm-binary-torch-src-or-binary + - name: Configure llvm-binary-torch-src-or-binary # Should be the fastest builds for CI and fails fast # OSX CMake flags are ignore on Linux if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE - cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -B build -GNinja \ + cmake -GNinja -Bbuild \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_LINKER=lld \ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ @@ -66,15 +66,16 @@ jobs: -DTORCH_MLIR_USE_INSTALLED_PYTORCH=${{ matrix.torch-binary }} \ -DCMAKE_OSX_ARCHITECTURES=${{ matrix.taregetarch }} \ -DMACOSX_DEPLOYMENT_TARGET=10.15 \ - -DLLVM_TARGETS_TO_BUILD=host + -DLLVM_TARGETS_TO_BUILD=host \ + $GITHUB_WORKSPACE/externals/llvm-project/llvm - - name: llvm-source-out-of-tree-torch-src-or-binary + - name: Configure llvm-source-out-of-tree-torch-src-or-binary # This build takes a while but is expected to almost always be cached. # A cache invalidation occurs when the committed LLVM version is changed. if: matrix.llvmtype == 'source' run: | cd $GITHUB_WORKSPACE - cmake -Bllvm-build -GNinja \ + cmake -GNinja -Bllvm-build \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_LINKER=lld \ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ @@ -101,35 +102,40 @@ jobs: -DPython3_EXECUTABLE=$(which python) \ . - - name: Build and run check-torch-mlir-all + - name: Build torch-mlir + # Build step for both in-tree and out-of-tree workflows + run: | + cmake --build build + + - name: Run torch-mlir unit tests if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" cmake --build build --target check-torch-mlir-all - - name: RefBackend - TorchScript end-to-end tests + - name: Run RefBackend - TorchScript end-to-end tests if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" python -m e2e_testing.torchscript.main --config=refbackend -v - - name: EagerMode - TorchScript end-to-end tests + - name: Run EagerMode - TorchScript end-to-end tests if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" python -m e2e_testing.torchscript.main --config=eager_mode -v - - name: TOSA backend - TorchScript end-to-end tests + - name: Run TOSA backend - TorchScript end-to-end tests if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" python -m e2e_testing.torchscript.main --config=tosa -v - - name: Lazy Tensor Core - TorchScript end-to-end tests + - name: Run Lazy Tensor Core - TorchScript end-to-end tests if: matrix.llvmtype == 'binary' run: | cd $GITHUB_WORKSPACE