diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index ede3010d7..e463a9402 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -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: @@ -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 @@ -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 @@ -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 }}