Skip to content

Commit

Permalink
try ccache for TVM build
Browse files Browse the repository at this point in the history
  • Loading branch information
mshr-h committed Dec 1, 2023
1 parent c1ad878 commit ed76dfe
Showing 1 changed file with 11 additions and 7 deletions.
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 }}-${{ matrix.python-version }}-${{ 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

0 comments on commit ed76dfe

Please sign in to comment.