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

Updating macOS runner version #668

Merged
merged 3 commits into from
Dec 27, 2022
Merged
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
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