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 }}
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