mirror of https://github.com/llvm/torch-mlir
buildAndTest.yml for matrix builds (#1098)
* Update buildAndTest.yml test with fast-fail matrix builds * Remove redundant and statement * Downgrade to 20.04 Until upstream PyTorch FBGEMM is fixed to compile with clang+14+ https://github.com/pytorch/pytorch/pull/82396 * Update buildAndTest.yml run tests on only the binary config.pull/1056/merge
parent
9a1203c844
commit
db4a6991a0
|
@ -8,10 +8,33 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-validate:
|
||||||
name: Build and Test (Release Asserts)
|
strategy:
|
||||||
# Changes to the name of this job needs to be synced with releaseSnapshotPackage.yml.
|
fail-fast: true
|
||||||
runs-on: ubuntu-20.04
|
matrix:
|
||||||
|
os: [macos-12, ubuntu-20.04]
|
||||||
|
targetarch: [x86_64, AArch64]
|
||||||
|
python-version: ["3.10"]
|
||||||
|
torch-binary: [ON, OFF]
|
||||||
|
llvmtype: [source, binary]
|
||||||
|
llvmbuildtype: [in-tree, out-of-tree]
|
||||||
|
exclude:
|
||||||
|
# No need for "out-of-tree LLVM and PyTorch source"
|
||||||
|
- llvmtype: source
|
||||||
|
llvmbuildtype: in-tree
|
||||||
|
- llvmtype: binary
|
||||||
|
llvmbuildtype: out-of-tree
|
||||||
|
# Disable M1 builds until https://github.com/llvm/torch-mlir/issues/1094 is fixed
|
||||||
|
- targetarch: AArch64
|
||||||
|
# macOS we only do source builds to reduce options
|
||||||
|
- os: macos-12
|
||||||
|
torch-binary: OFF
|
||||||
|
- os: macos-12
|
||||||
|
llvmtype: source
|
||||||
|
- os: macos-12
|
||||||
|
llvmtype: out-of-tree
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get torch-mlir
|
- name: Get torch-mlir
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -19,13 +42,15 @@ jobs:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- uses: ./.github/actions/setup-build
|
- uses: ./.github/actions/setup-build
|
||||||
with:
|
with:
|
||||||
cache-suffix: ''
|
cache-suffix: ${{ matrix.os }}-${{ matrix.targetarch }}-${{ matrix.buildtype }}
|
||||||
- name: Build and Test torch-mlir (Assert)
|
|
||||||
|
- name: 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: |
|
run: |
|
||||||
cd $GITHUB_WORKSPACE
|
cd $GITHUB_WORKSPACE
|
||||||
mkdir build
|
cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -B build -GNinja \
|
||||||
cd build
|
|
||||||
cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -GNinja \
|
|
||||||
-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 \
|
||||||
|
@ -38,38 +63,15 @@ jobs:
|
||||||
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="${GITHUB_WORKSPACE}/external/llvm-external-projects/torch-mlir-dialects" \
|
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="${GITHUB_WORKSPACE}/external/llvm-external-projects/torch-mlir-dialects" \
|
||||||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
||||||
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
||||||
|
-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
|
||||||
ninja check-torch-mlir-all
|
|
||||||
- name: RefBackend - TorchScript end-to-end tests
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
|
|
||||||
build-out-of-tree:
|
- name: llvm-source-out-of-tree-torch-src-or-binary
|
||||||
name: Build out-of-tree (Release Asserts)
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Get torch-mlir
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- uses: ./.github/actions/setup-build
|
|
||||||
with:
|
|
||||||
cache-suffix: '-out-of-tree'
|
|
||||||
- name: Build LLVM (standalone)
|
|
||||||
# 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'
|
||||||
run: |
|
run: |
|
||||||
cd $GITHUB_WORKSPACE
|
cd $GITHUB_WORKSPACE
|
||||||
cmake -Bllvm-build -GNinja \
|
cmake -Bllvm-build -GNinja \
|
||||||
|
@ -82,121 +84,44 @@ jobs:
|
||||||
-DLLVM_ENABLE_PROJECTS=mlir \
|
-DLLVM_ENABLE_PROJECTS=mlir \
|
||||||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
||||||
-DLLVM_TARGETS_TO_BUILD=host \
|
-DLLVM_TARGETS_TO_BUILD=host \
|
||||||
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
|
||||||
externals/llvm-project/llvm
|
externals/llvm-project/llvm
|
||||||
ninja -Cllvm-build
|
cmake --build llvm-build
|
||||||
|
|
||||||
- name: Build and test torch-mlir (out-of-tree)
|
|
||||||
run: |
|
|
||||||
cd $GITHUB_WORKSPACE
|
|
||||||
cmake -GNinja -Bbuild \
|
cmake -GNinja -Bbuild \
|
||||||
-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 \
|
||||||
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
||||||
-DMLIR_DIR="$(pwd)/llvm-build/lib/cmake/mlir/" \
|
-DMLIR_DIR="$(pwd)/llvm-build/lib/cmake/mlir/" \
|
||||||
-DLLVM_DIR="$(pwd)/llvm-build/lib/cmake/llvm/" \
|
-DLLVM_DIR="$(pwd)/llvm-build/lib/cmake/llvm/" \
|
||||||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
-DMLIR_ENABLE_BINDINGS_PYTHON=OFF \
|
||||||
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
||||||
|
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=${{ matrix.torch-binary }} \
|
||||||
-DPython3_EXECUTABLE=$(which python) \
|
-DPython3_EXECUTABLE=$(which python) \
|
||||||
.
|
.
|
||||||
ninja -Cbuild check-torch-mlir-all
|
|
||||||
|
|
||||||
# Don't run python tests, as check-torch-mlir-all already checks
|
- name: Build and run check-torch-mlir-all
|
||||||
# what we want.
|
if: matrix.llvmtype == 'binary'
|
||||||
|
|
||||||
build-from-src:
|
|
||||||
name: Build and Test Source Build (Release Asserts)
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Get torch-mlir
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- uses: ./.github/actions/setup-build
|
|
||||||
with:
|
|
||||||
cache-suffix: 'src-linux'
|
|
||||||
- name: Build and Test torch-mlir (Assert)
|
|
||||||
run: |
|
run: |
|
||||||
cd $GITHUB_WORKSPACE
|
cd $GITHUB_WORKSPACE
|
||||||
mkdir build
|
export PYTHONPATH="$GITHUB_WORKSPACE/build/tools/torch-mlir/python_packages/torch_mlir"
|
||||||
cd build
|
cmake --build build --target check-torch-mlir-all
|
||||||
cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -GNinja \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_LINKER=lld \
|
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
||||||
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
|
||||||
-DPython3_EXECUTABLE=$(which python) \
|
|
||||||
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
||||||
-DLLVM_ENABLE_PROJECTS=mlir \
|
|
||||||
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \
|
|
||||||
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$GITHUB_WORKSPACE" \
|
|
||||||
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="${GITHUB_WORKSPACE}/external/llvm-external-projects/torch-mlir-dialects" \
|
|
||||||
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
|
||||||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
|
||||||
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=OFF \
|
|
||||||
-DLLVM_TARGETS_TO_BUILD=host
|
|
||||||
ninja check-torch-mlir-all
|
|
||||||
- name: RefBackend - TorchScript end-to-end tests
|
- name: RefBackend - TorchScript end-to-end tests
|
||||||
|
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
|
|
||||||
macOS-x86_64:
|
|
||||||
name: Build and Test macOS(x86_64) Build (Release Asserts)
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- name: Get torch-mlir
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- uses: ./.github/actions/setup-build
|
|
||||||
with:
|
|
||||||
cache-suffix: '-macos-x86_64'
|
|
||||||
- name: Build and Test torch-mlir (Assert)
|
|
||||||
run: |
|
|
||||||
cd $GITHUB_WORKSPACE
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake $GITHUB_WORKSPACE/externals/llvm-project/llvm -GNinja \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_LINKER=lld \
|
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
||||||
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
|
|
||||||
-DPython3_EXECUTABLE=$(which python) \
|
|
||||||
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
||||||
-DLLVM_ENABLE_PROJECTS=mlir \
|
|
||||||
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \
|
|
||||||
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR="$GITHUB_WORKSPACE" \
|
|
||||||
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="${GITHUB_WORKSPACE}/external/llvm-external-projects/torch-mlir-dialects" \
|
|
||||||
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
|
||||||
-DTORCH_MLIR_ENABLE_MHLO=ON \
|
|
||||||
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=OFF \
|
|
||||||
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
|
||||||
-DMACOSX_DEPLOYMENT_TARGET=10.15 \
|
|
||||||
-DLLVM_TARGETS_TO_BUILD=host
|
|
||||||
ninja check-torch-mlir-all
|
|
||||||
- name: RefBackend - TorchScript end-to-end tests
|
|
||||||
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: EagerMode - TorchScript end-to-end tests
|
||||||
|
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: TOSA backend - TorchScript end-to-end tests
|
||||||
|
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"
|
||||||
|
|
Loading…
Reference in New Issue