Enable OOT builds in CI (#1188)

pull/1202/head
Sambhav Jain 2022-08-09 12:13:16 -07:00 committed by GitHub
parent e75c7c5292
commit b696362b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 11 deletions

View File

@ -36,7 +36,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Get torch-mlir - name: Checkout torch-mlir
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: 'true' submodules: 'true'
@ -44,13 +44,13 @@ jobs:
with: with:
cache-suffix: ${{ matrix.os }}-${{ matrix.targetarch }}-${{ matrix.llvmtype }}-${{ matrix.llvmbuildtype }} 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 # Should be the fastest builds for CI and fails fast
# OSX CMake flags are ignore on Linux # OSX CMake flags are ignore on Linux
if: matrix.llvmtype == 'binary' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -B build -GNinja \ cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LINKER=lld \ -DCMAKE_LINKER=lld \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
@ -66,15 +66,16 @@ jobs:
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=${{ matrix.torch-binary }} \ -DTORCH_MLIR_USE_INSTALLED_PYTORCH=${{ matrix.torch-binary }} \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.taregetarch }} \ -DCMAKE_OSX_ARCHITECTURES=${{ matrix.taregetarch }} \
-DMACOSX_DEPLOYMENT_TARGET=10.15 \ -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. # This build takes a while but is expected to almost always be cached.
# A cache invalidation occurs when the committed LLVM version is changed. # A cache invalidation occurs when the committed LLVM version is changed.
if: matrix.llvmtype == 'source' if: matrix.llvmtype == 'source'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
cmake -Bllvm-build -GNinja \ cmake -GNinja -Bllvm-build \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LINKER=lld \ -DCMAKE_LINKER=lld \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
@ -101,35 +102,40 @@ jobs:
-DPython3_EXECUTABLE=$(which python) \ -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' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
cmake --build build --target check-torch-mlir-all 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' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
python -m e2e_testing.torchscript.main --config=refbackend -v 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' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
python -m e2e_testing.torchscript.main --config=eager_mode -v 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' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir" export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
python -m e2e_testing.torchscript.main --config=tosa -v 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' if: matrix.llvmtype == 'binary'
run: | run: |
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE