From 9a2031d3f37ded6603d4ad68271817ee3c012b29 Mon Sep 17 00:00:00 2001 From: driazati Date: Mon, 11 Jul 2022 14:24:36 -0700 Subject: [PATCH 1/5] Set up for building release wheels --- .github/workflows/wheel_manylinux_pypi.yaml | 15 +++++--- .github/workflows/wheel_winmac_nightly.yaml | 38 ++++++++++++++++++--- common/sync_package.py | 2 +- wheel/build_lib_osx.sh | 4 +-- wheel/build_lib_win.bat | 1 + wheel/build_wheel_manylinux.sh | 1 + 6 files changed, 49 insertions(+), 12 deletions(-) diff --git a/.github/workflows/wheel_manylinux_pypi.yaml b/.github/workflows/wheel_manylinux_pypi.yaml index bf9fe6e..0f94fe8 100644 --- a/.github/workflows/wheel_manylinux_pypi.yaml +++ b/.github/workflows/wheel_manylinux_pypi.yaml @@ -5,6 +5,7 @@ on: push: branches: - main + - release/* workflow_dispatch: pull_request: branches: @@ -16,32 +17,34 @@ jobs: Build: strategy: matrix: - pkg: ['pypi-nightly'] # matrix of build configs config: - cuda: 'none' image: 'tlcpack/package-cpu:v0.5' 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' @@ -50,14 +53,16 @@ jobs: WHEEL_TEST: "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' + # 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/* diff --git a/.github/workflows/wheel_winmac_nightly.yaml b/.github/workflows/wheel_winmac_nightly.yaml index a47ce7f..b609b6e 100644 --- a/.github/workflows/wheel_winmac_nightly.yaml +++ b/.github/workflows/wheel_winmac_nightly.yaml @@ -5,9 +5,11 @@ on: push: branches: - main + - release/* pull_request: branches: - main + workflow_dispatch: schedule: - cron: '0 6 * * *' # 6 AM UTC @@ -15,11 +17,13 @@ jobs: Build: strategy: matrix: - os: [macOS-latest, windows-2019] - pkg: ['tlcpack', 'tlcpack-nightly'] - + os: + - macOS-latest + - windows-2019 + pkg: + - tlcpack + - tlcpack-nightly runs-on: ${{ matrix.os }} - steps: - uses: actions/checkout@v2 - uses: actions/cache@v1 @@ -50,11 +54,13 @@ jobs: 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: @@ -66,6 +72,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 @@ -76,6 +83,29 @@ 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 + + - uses: actions/setup-python@v2 + with: + python-version: 3.10 + - name: Wheel-Build@Py310 + 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' diff --git a/common/sync_package.py b/common/sync_package.py index a7e1b8a..4a53bf6 100644 --- a/common/sync_package.py +++ b/common/sync_package.py @@ -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): diff --git a/wheel/build_lib_osx.sh b/wheel/build_lib_osx.sh index d68b647..4314540 100755 --- a/wheel/build_lib_osx.sh +++ b/wheel/build_lib_osx.sh @@ -1,7 +1,6 @@ #!/bin/bash -set -e -set -u +set -eux cd tvm rm -f config.cmake @@ -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 \ .. diff --git a/wheel/build_lib_win.bat b/wheel/build_lib_win.bat index c975981..0e48536 100644 --- a/wheel/build_lib_win.bat +++ b/wheel/build_lib_win.bat @@ -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 ^ .. diff --git a/wheel/build_wheel_manylinux.sh b/wheel/build_wheel_manylinux.sh index 19b41e6..a19e446 100755 --- a/wheel/build_wheel_manylinux.sh +++ b/wheel/build_wheel_manylinux.sh @@ -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 From e0893bcee5dd2043d636eef3ace845b34d3f2e46 Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Sat, 23 Jul 2022 04:10:24 +0100 Subject: [PATCH 2/5] Generate PEP503 compliant wheel directory (#123) PEP503 (https://peps.python.org/pep-0503/) requires that a wheel directory must be a valid HTML5 page. --- wheel/wheel_prune_and_sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wheel/wheel_prune_and_sync.py b/wheel/wheel_prune_and_sync.py index 61e340d..6d493a1 100644 --- a/wheel/wheel_prune_and_sync.py +++ b/wheel/wheel_prune_and_sync.py @@ -109,12 +109,13 @@ def list_wheels(repo): def update_wheel_page(keep_list, site_repo, dry_run=False): """Update the wheel page""" - new_html = "" + new_html = '\n\n\n' for asset in keep_list: new_html += '%s
\n' % ( asset.browser_download_url, asset.name, ) + new_html += '\n' def run_cmd(cmd): proc = subprocess.Popen( From 8c635dba8be610262328016f84eaca66290fb352 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Sun, 24 Jul 2022 22:26:45 -0700 Subject: [PATCH 3/5] fix cuda path (#122) --- docker/Dockerfile.package-cu110 | 3 +++ docker/Dockerfile.package-cu111 | 3 +++ docker/Dockerfile.package-cu113 | 3 +++ 3 files changed, 9 insertions(+) diff --git a/docker/Dockerfile.package-cu110 b/docker/Dockerfile.package-cu110 index 43e346a..5b5e62c 100644 --- a/docker/Dockerfile.package-cu110 +++ b/docker/Dockerfile.package-cu110 @@ -40,6 +40,9 @@ 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.0 /usr/local/cuda + # Environment variables ENV PATH=/usr/local/cuda/bin:${PATH} ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH} diff --git a/docker/Dockerfile.package-cu111 b/docker/Dockerfile.package-cu111 index d680f6f..8a66f95 100644 --- a/docker/Dockerfile.package-cu111 +++ b/docker/Dockerfile.package-cu111 @@ -40,6 +40,9 @@ 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.1 /usr/local/cuda + # Environment variables ENV PATH=/usr/local/cuda/bin:${PATH} ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH} diff --git a/docker/Dockerfile.package-cu113 b/docker/Dockerfile.package-cu113 index 051fbdb..d148393 100644 --- a/docker/Dockerfile.package-cu113 +++ b/docker/Dockerfile.package-cu113 @@ -40,6 +40,9 @@ 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.3 /usr/local/cuda + # Environment variables ENV PATH=/usr/local/cuda/bin:${PATH} ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH} From e18b7c469babc95e2be242998b04b99144e32e93 Mon Sep 17 00:00:00 2001 From: Florin Blanaru Date: Thu, 28 Jul 2022 18:06:35 +0300 Subject: [PATCH 4/5] Build MacOS release wheel --- .github/workflows/wheel_winmac_nightly.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/wheel_winmac_nightly.yaml b/.github/workflows/wheel_winmac_nightly.yaml index b609b6e..11ce5c8 100644 --- a/.github/workflows/wheel_winmac_nightly.yaml +++ b/.github/workflows/wheel_winmac_nightly.yaml @@ -17,12 +17,9 @@ 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 @@ -48,7 +45,11 @@ 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} @@ -94,7 +95,6 @@ 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.10 @@ -105,12 +105,12 @@ jobs: 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 From 72fd669e01d1f0cf6aa536f40c35e37157da7361 Mon Sep 17 00:00:00 2001 From: Florin Blanaru Date: Thu, 28 Jul 2022 18:25:01 +0300 Subject: [PATCH 5/5] push --- .github/workflows/wheel_winmac_nightly.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/wheel_winmac_nightly.yaml b/.github/workflows/wheel_winmac_nightly.yaml index 11ce5c8..66d6644 100644 --- a/.github/workflows/wheel_winmac_nightly.yaml +++ b/.github/workflows/wheel_winmac_nightly.yaml @@ -6,6 +6,7 @@ on: branches: - main - release/* + - release-build-macos pull_request: branches: - main @@ -95,16 +96,6 @@ 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.10 - - name: Wheel-Build@Py310 - 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'