Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ccache for TVM build #741

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,28 @@ jobs:
- name: Install TVM from pypi if Ubuntu
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: python -m pip install apache-tvm==0.10.0
- name: Install ccache if Mac
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install ccache
- uses: actions/cache@v3
# TVM takes forever, we try to cache it.
if: ${{ startsWith(matrix.os, 'macos')}}
id: cache
env:
CACHE_NUMBER: 9
CACHE_NUMBER: 10
with:
path: ~/work/hummingbird/tvm
key: ${{ matrix.os }}-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-tvm-0.10
# Getting TVM requires: 1) Install LLVM 2) fetching TVM from github, 3) cmake, 4) make, 5) install python dependency.
path: ~/work/hummingbird/.cache/ccache
key: ${{ matrix.os }}-${{ env.CACHE_NUMBER }}
# Getting TVM requires: 1) Install LLVM 2) fetching TVM from github, 3) cmake, 4) make, 5) install python dependency.
# 2 to 4 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: Install LLVM if Mac
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install llvm@14
- name: Fetch and prepare TVM for compilation if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
cd ~/work/hummingbird
git clone https://github.com/apache/tvm.git
Expand All @@ -110,7 +114,7 @@ jobs:
git submodule update --recursive --init
cmake -E make_directory build
- name: CMake TVM if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
if: ${{ startsWith(matrix.os, 'macos') }}
working-directory: ../tvm/build
run: >-
MACOSX_DEPLOYMENT_TARGET=10.13 cmake
Expand All @@ -119,7 +123,7 @@ jobs:
"-DUSE_LLVM=$(brew --prefix llvm@14)/bin/llvm-config --link-static"
..
- name: Build TVM if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
if: ${{ startsWith(matrix.os, 'macos') }}
working-directory: ../tvm/build
run: |
make -j3
Expand Down