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

Release build for macos #125

Open
wants to merge 3 commits into
base: release/v0.9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
49 changes: 34 additions & 15 deletions .github/workflows/wheel_manylinux_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- release/*
workflow_dispatch:
pull_request:
branches:
Expand All @@ -16,48 +17,66 @@ jobs:
Build:
strategy:
matrix:
pkg: ['pypi-nightly']
# matrix of build configs
fail-fast: false
config:
- cuda: 'none'
image: 'tlcpack/package-cpu:v0.5'
package_name: 'apache-tvm'

- cuda: '10.2'
image: 'tlcpack/package-cu102:v0.5'
package_name: 'apache-tvm'
- cuda: '11.3'
image: 'tlcpack/package-cu113:v0.1'
package_name: 'apache-tvm'
- cuda: '11.6'
image: 'tlcpack/package-cu116:v0.1'
package_name: 'apache-tvm'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: TVM checkout
run: |
set -eux
git clone https://github.com/apache/tvm tvm --recursive
- name: Sync Package
env:
TAG: pypi
run: |
set -eux
python3 common/sync_package.py \
--cuda ${{ matrix.config.cuda }} \
--package-name ${{ matrix.config.package_name }} \
--use-public-version \
${{ matrix.pkg }}
"$TAG"
- name: Build
env:
IMAGE: ${{ matrix.config.image }}
CUDA: ${{ matrix.config.cuda }}
run: |
set -eux
docker/bash.sh --no-gpu $IMAGE ./wheel/build_wheel_manylinux.sh --cuda $CUDA
- name: Test
if: matrix.config.cuda == 'none'
env:
IMAGE: ${{ matrix.config.image }}
WHEEL_TEST: "True"
continue-on-error: true
# continue-on-error: true
run: |
set -eux
docker/bash.sh --no-gpu $IMAGE ./wheel/run_tests.sh
- name: Wheel-Deploy-Pypi
if: github.ref == 'refs/heads/main'
env:
TWINE_NON_INTERACTIVE: 1
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
run: |
python3 -m pip install twine
twine upload tvm/python/repaired_wheels/*
- uses: actions/upload-artifact@v3
with:
name: wheel-${{ matrix.config.package_name }}-${{ matrix.config-cuda }}
path: tvm/python/repaired_wheels
# - name: Wheel-Deploy-Pypi
# # if: github.ref == 'refs/heads/main'
# env:
# TWINE_NON_INTERACTIVE: 1
# TWINE_REPOSITORY: pypi
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
# run: |
# set -eux
# python3 -m pip install twine
# twine upload tvm/python/repaired_wheels/*
31 changes: 26 additions & 5 deletions .github/workflows/wheel_winmac_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ on:
push:
branches:
- main
- release/*
- release-build-macos
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # 6 AM UTC

jobs:
Build:
strategy:
matrix:
os: [macOS-latest, windows-2019]
pkg: ['tlcpack', 'tlcpack-nightly']
os: [macOS-latest]
# pkg: ['tlcpack', 'tlcpack-nightly']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
Expand All @@ -44,17 +46,23 @@ jobs:
run: |
git clone https://github.com/apache/tvm tvm --recursive
- name: Sync Package
run: python3 common/sync_package.py ${{ matrix.pkg }}
env:
TAG: pypi
run: |
set -eux
python3 common/sync_package.py "$TAG"
- name: Build@MacOS
if: startsWith(matrix.os, 'macOS')
shell: bash -l {0}
run: >-
wheel/build_lib_osx.sh

- name: Build@Win
if: startsWith(matrix.os, 'windows')
shell: cmd /C call {0}
run: >-
wheel/build_lib_win.bat

# Build wheel for three python versions
- uses: actions/setup-python@v2
with:
Expand All @@ -66,6 +74,7 @@ jobs:
python -m pip install setuptools Cython wheel
cd tvm/python
python setup.py bdist_wheel

- uses: actions/setup-python@v2
with:
python-version: 3.8
Expand All @@ -76,11 +85,23 @@ jobs:
python -m pip install setuptools Cython wheel
cd tvm/python
python setup.py bdist_wheel

- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Wheel-Build@Py39
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
run: |
python -m pip install setuptools Cython wheel
cd tvm/python
python setup.py bdist_wheel
# Use system python instead of conda for upload
- name: Wheel-Deploy
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.TLCPACK_GITHUB_TOKEN }}
run: |
set -eux
python3 -m pip install github3.py
python3 wheel/wheel_upload.py --tag v0.7.dev1 tvm/python/dist
4 changes: 2 additions & 2 deletions common/sync_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Modify the following two settings during release
# -----------------------------------------------------------
# Tag used for stable build.
__stable_build__ = "v0.8"
__stable_build__ = "v0.9.0"
# -----------------------------------------------------------

def py_str(cstr):
Expand Down Expand Up @@ -156,7 +156,7 @@ def main():
parser.add_argument("--cuda",
type=str,
default="none",
choices=["none", "10.2", "11.0", "11.1", "11.3"],
choices=["none", "10.2", "11.0", "11.1", "11.3", "11.6"],
help="CUDA version to be linked to the resultant binaries,"
"or none, to disable CUDA. Defaults to none.")
parser.add_argument("--package-name",
Expand Down
52 changes: 52 additions & 0 deletions docker/Dockerfile.package-cu116
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Docker image: tlcpack/package-cu116

FROM pytorch/manylinux-cuda116

# install core
COPY install/centos_install_core.sh /install/centos_install_core.sh
RUN bash /install/centos_install_core.sh

# install cmake
COPY install/centos_install_cmake.sh /install/centos_install_cmake.sh
RUN bash /install/centos_install_cmake.sh

# build llvm
COPY install/centos_build_llvm.sh /install/centos_build_llvm.sh
RUN bash /install/centos_build_llvm.sh 10.0

# upgrade patchelf due to the bug in patchelf 0.10
# see details at https://stackoverflow.com/questions/61007071/auditwheel-repair-not-working-as-expected
COPY install/centos_install_patchelf.sh /install/centos_install_patchelf.sh
RUN bash /install/centos_install_patchelf.sh

# Install Arm Ethos-N NPU driver stack
COPY install/centos_install_arm_ethosn_driver_stack.sh /install/centos_install_arm_ethosn_driver_stack.sh
RUN bash /install/centos_install_arm_ethosn_driver_stack.sh

# Install Compute Library for Arm(r) Architecture (ACL)
COPY install/centos_install_arm_compute_library.sh /install/centos_install_arm_compute_library.sh
RUN bash /install/centos_install_arm_compute_library.sh

# Install Conda
COPY install/centos_install_conda.sh /install/centos_install_conda.sh
RUN bash /install/centos_install_conda.sh
ENV PATH=/opt/conda/bin:${PATH}

# install python packages
COPY install/centos_install_python_package.sh /install/centos_install_python_package.sh
RUN bash /install/centos_install_python_package.sh 3.7
RUN bash /install/centos_install_python_package.sh 3.8

COPY install/centos_install_auditwheel.sh /install/centos_install_auditwheel.sh
RUN bash /install/centos_install_auditwheel.sh

# Set default CUDA
RUN rm /usr/local/cuda; ln -s /usr/local/cuda-11.6 /usr/local/cuda

# Environment variables
ENV PATH=/usr/local/cuda/bin:${PATH}
ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH}
ENV C_INCLUDE_PATH=/usr/local/cuda/include:${C_INCLUDE_PATH}
ENV LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/compact:${LIBRARY_PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/compact:${LD_LIBRARY_PATH}
ENV AUDITWHEEL_PLAT=manylinux2014_x86_64
4 changes: 2 additions & 2 deletions wheel/build_lib_osx.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -e
set -u
set -eux

cd tvm
rm -f config.cmake
Expand All @@ -23,6 +22,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_ETHOSU=ON \
-DUSE_CMSISNN=ON \
-DUSE_MICRO=ON \
-DSUMMARIZE=ON \
-DUSE_MICRO_STANDALONE_RUNTIME=ON \
-DUSE_METAL=ON \
..
Expand Down
1 change: 1 addition & 0 deletions wheel/build_lib_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cmake -A x64 -Thost=x64 ^
-DUSE_RPC=ON ^
-DUSE_SORT=ON ^
-DUSE_RANDOM=ON ^
-DSUMMARIZE=ONE ^
-DUSE_GRAPH_RUNTIME_DEBUG=ON ^
..

Expand Down
1 change: 1 addition & 0 deletions wheel/build_wheel_manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ echo set\(USE_ETHOSN /opt/arm/ethosn-driver\) >> config.cmake
echo set\(USE_ARM_COMPUTE_LIB /opt/arm/acl\) >> config.cmake
echo set\(USE_MICRO ON\) >> config.cmake
echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
echo set\(SUMMARIZE ON\) >> config.cmake
echo set\(USE_ETHOSU ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
if [[ ${CUDA} != "none" ]]; then
Expand Down