Skip to content

Commit

Permalink
Revert macOS delocate to local PyTorch and add CI
Browse files Browse the repository at this point in the history
Revert the path to local PyTorch directory now that libtorch is
reverted. Also add a CI test for SRC builds
  • Loading branch information
powderluv committed Jul 15, 2022
1 parent afdaa60 commit 7524933
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion build_tools/python_deploy/build_macos_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7524933

Please sign in to comment.