From d9648ba75b5aef9ac1365f31dd78a9a638d8376a Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Tue, 18 Jul 2023 12:11:44 +0000 Subject: [PATCH 1/4] Fix Cython compile for v3.0.0 release Cython `v3.0.0` was recently released (https://github.com/cython/cython/releases/tag/3.0.0) and is used in newly built docker images. This causes a compilation issue since 3.0.0 expects function definitions to be explicitly declared with the `noexcept` annotation. This change should be backwards compatible to `v0.29.*`. For more details see the discussion here: https://github.com/scipy/scipy/issues/17234#issuecomment-1493423202. Change-Id: Ic252ddfb4262a3b0fffe93c5ca4b9729bf167e05 --- python/tvm/_ffi/_cython/ndarray.pxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/_ffi/_cython/ndarray.pxi b/python/tvm/_ffi/_cython/ndarray.pxi index 9d0eeff0b07d..51e0e91a7691 100644 --- a/python/tvm/_ffi/_cython/ndarray.pxi +++ b/python/tvm/_ffi/_cython/ndarray.pxi @@ -21,7 +21,7 @@ cdef const char* _c_str_dltensor = "dltensor" cdef const char* _c_str_used_dltensor = "used_dltensor" -cdef void _c_dlpack_deleter(object pycaps): +cdef void _c_dlpack_deleter(object pycaps) noexcept: cdef DLManagedTensor* dltensor if pycapsule.PyCapsule_IsValid(pycaps, _c_str_dltensor): dltensor = pycapsule.PyCapsule_GetPointer(pycaps, _c_str_dltensor) From db6bef347adc573edb6579306679f22bd8d831f9 Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Tue, 18 Jul 2023 18:37:32 +0000 Subject: [PATCH 2/4] Upgrade the python version for windows and macos builds Upgrades the python version from 3.7 to 3.8 to use newer versions of cython. Change-Id: Id5e280eebaae1d367774ad0952234a1458cc1c33 --- conda/build-environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/build-environment.yaml b/conda/build-environment.yaml index a1b43eb6ef0c..d5522cbdd6cf 100644 --- a/conda/build-environment.yaml +++ b/conda/build-environment.yaml @@ -25,7 +25,7 @@ channels: # The packages to install to the environment dependencies: - - python=3.7 # or 3.8. See https://github.com/apache/tvm/issues/8577 for more details on >= 3.9 + - python=3.8 # See https://github.com/apache/tvm/issues/8577 for more details on >= 3.9 - conda-build - git - llvmdev >=11 From 9973b30d82cb468592b969264bd4503e25dd9d59 Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Wed, 19 Jul 2023 10:12:42 +0000 Subject: [PATCH 3/4] Update python version in action.yml Change-Id: I67c8342dc963b4b8e955aede9282551297be0c14 --- .github/actions/setup/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index b32ff90325d7..69c702548b6f 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -16,7 +16,7 @@ runs: environment-file: conda/build-environment.yaml auto-activate-base: false use-only-tar-bz2: true - python-version: 3.7 + python-version: 3.8 condarc-file: conda/condarc - uses: conda-incubator/setup-miniconda@v2 if: steps.conda1.outcome == 'failure' @@ -26,7 +26,7 @@ runs: environment-file: conda/build-environment.yaml auto-activate-base: false use-only-tar-bz2: true - python-version: 3.7 + python-version: 3.8 condarc-file: conda/condarc - name: Conda info shell: pwsh From ab5215dcd3b2df7eab2b1eb5ea34423813038a1c Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Fri, 21 Jul 2023 14:47:26 +0000 Subject: [PATCH 4/4] Remove version pin and set minimum version of cython in conda Change-Id: I01b60b5ff5e6ba8df4e1afdd5ff931ae7dd77775 --- conda/build-environment.yaml | 2 +- docker/install/ubuntu_install_python_package.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/build-environment.yaml b/conda/build-environment.yaml index d5522cbdd6cf..9a8ed85214c1 100644 --- a/conda/build-environment.yaml +++ b/conda/build-environment.yaml @@ -31,7 +31,7 @@ dependencies: - llvmdev >=11 - numpy - pytest - - cython + - cython>=0.29.31 - cmake - bzip2 - make diff --git a/docker/install/ubuntu_install_python_package.sh b/docker/install/ubuntu_install_python_package.sh index ba5d47bfcc48..41c8697f4234 100755 --- a/docker/install/ubuntu_install_python_package.sh +++ b/docker/install/ubuntu_install_python_package.sh @@ -25,7 +25,7 @@ pip3 install --upgrade \ "Pygments>=2.4.0" \ attrs \ cloudpickle \ - cython==0.29.34 \ + cython \ decorator \ mypy \ numpy==1.21.* \