Skip to content

Commit

Permalink
Use pre-installed LLVM for building TVM on macOS-11 (#615)
Browse files Browse the repository at this point in the history
* use pre-installed LLVM for TVM compilation

* increase CACHE_NUMBER
  • Loading branch information
mshr-h authored Aug 5, 2022
1 parent ac2f281 commit 08e48cc
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ jobs:
if: ${{ matrix.os == 'macos-11' }}
id: cache
env:
CACHE_NUMBER: 6
CACHE_NUMBER: 7
with:
path: ../../../tvm
key: ${{ runner.os }}-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-tvm-0.9
# Getting TVM requires: 1) fetching TVM from github, 2) get LLVM, 3) cmake, 4) make, 5) install python dependecy.
# 1 to 4 will be retrieved from the cache.
# Getting TVM requires: 1) fetching TVM from github, 2) cmake, 3) make, 4) install python dependecy.
# 1 to 3 will be retrieved from the cache.
# The pipeline only works for Unix systems. For windows we will have to compile LLVM from source which is a no go.
- name: Fetch and prepare TVM for compilation if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-11' }}
Expand All @@ -101,20 +101,14 @@ jobs:
git checkout tags/v0.9.0
git submodule update --recursive --init
cmake -E make_directory build
- name: Get LLVM on Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-11' }}
working-directory: ../../../tvm
run: |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz
tar -xf clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz && mv clang+llvm-10.0.0-x86_64-apple-darwin llvm
- name: CMake TVM if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-11' }}
working-directory: ../../../tvm/build
run: >-
cmake
"-DUSE_RPC=ON"
"-DUSE_GRAPH_RUNTIME=ON"
"-DUSE_LLVM=../llvm/bin/llvm-config --link-static"
"-DUSE_LLVM=$(brew --prefix llvm@14)/bin/llvm-config --link-static"
..
- name: Build TVM if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-11' }}
Expand Down

0 comments on commit 08e48cc

Please sign in to comment.