diff --git a/.github/workflows/buildAndTest.yml b/.github/workflows/buildAndTest.yml index 6440d370c3a3..2016228447b0 100644 --- a/.github/workflows/buildAndTest.yml +++ b/.github/workflows/buildAndTest.yml @@ -100,3 +100,49 @@ jobs: # Don't run python tests, as check-torch-mlir-all already checks # what we want. + build-from-source: + name: Build and Test From Source (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: '' + - 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_USE_INSTALLED_PYTORCH=OFF \ + -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 diff --git a/build_tools/python_deploy/build_macos_packages.sh b/build_tools/python_deploy/build_macos_packages.sh index 1a4ffd8a0139..8744e30e6a19 100755 --- a/build_tools/python_deploy/build_macos_packages.sh +++ b/build_tools/python_deploy/build_macos_packages.sh @@ -105,7 +105,7 @@ function run_audit_wheel() { python"${python_version}" -m pip install -U pip python"${python_version}" -m pip install -r "$repo_root"/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu python"${python_version}" -m pip install "$generic_wheel" --extra-index-url https://download.pytorch.org/whl/nightly/cpu - DYLD_LIBRARY_PATH="$repo_root"/libtorch/lib delocate-wheel -v "$generic_wheel" + DYLD_LIBRARY_PATH=$output_dir/test_venv/lib/python${python_version}/site-packages/torch/lib delocate-wheel -v "$generic_wheel" deactivate rm -rf "$output_dir"/test_venv fi