Skip to content

Commit

Permalink
Updating macOS runner version (#668)
Browse files Browse the repository at this point in the history
* update macOS ver 11->12

* solve cache key conflict

* fix error on TVM installation
  • Loading branch information
mshr-h authored Dec 27, 2022
1 parent 41aae4b commit ef48e01
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-11, windows-2022]
os: [ubuntu-22.04, macos-12, windows-2022]
python-version: ['3.8', '3.9', '3.10']

steps:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Coverage on basic tests without extra
run: coverage run -a -m pytest tests/test_no_extra_install.py
- name: If mac, install libomp to facilitate lgbm install
if: matrix.os == 'macos-11'
if: ${{ startsWith(matrix.os, 'macos')}}
run: |
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew unlink libomp
Expand All @@ -82,18 +82,18 @@ jobs:
run: python -m pip install apache-tvm==0.10.0
- uses: actions/cache@v3
# TVM takes forever, we try to cache it.
if: ${{ matrix.os == 'macos-11' }}
if: ${{ startsWith(matrix.os, 'macos')}}
id: cache
env:
CACHE_NUMBER: 7
CACHE_NUMBER: 9
with:
path: ~/work/hummingbird/tvm
key: ${{ runner.os }}-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-tvm-0.10
key: ${{ matrix.os }}-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}-tvm-0.10
# Getting TVM requires: 1) fetching TVM from github, 2) cmake, 3) make, 4) install python dependency.
# 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' }}
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
run: |
cd ~/work/hummingbird
git clone https://github.com/apache/tvm.git
Expand All @@ -102,24 +102,27 @@ jobs:
git submodule update --recursive --init
cmake -E make_directory build
- name: CMake TVM if Mac
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-11' }}
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
working-directory: ../tvm/build
run: >-
cmake
MACOSX_DEPLOYMENT_TARGET=10.13 cmake
"-DUSE_RPC=ON"
"-DUSE_GRAPH_RUNTIME=ON"
"-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' }}
if: ${{ steps.cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos') }}
working-directory: ../tvm/build
run: |
make -j3
- name: Install python TVM if Mac
if: ${{ matrix.os == 'macos-11' }}
if: ${{ startsWith(matrix.os, 'macos') }}
working-directory: ../tvm/python
run: |
python setup.py install
python -m pip install -U wheel packaging
python setup.py bdist_wheel
python -m pip install dist/tvm-*.whl
# We don't run pytest for Linux py3.8 since we do coverage for that case.
- name: Test with pytest
if: ${{ matrix.python-version != '3.8' || startsWith(matrix.os, 'ubuntu') != true }}
Expand Down

0 comments on commit ef48e01

Please sign in to comment.