Skip to content

Conversation

@lhutton1
Copy link
Contributor

@lhutton1 lhutton1 commented Jul 18, 2023

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.31. For more details see the discussion here: scipy/scipy#17234 (comment).

@tvm-bot
Copy link
Collaborator

tvm-bot commented Jul 18, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to auto-tag found, no teams are specified in PR title See #10317 for details

Generated by tvm-bot

@lhutton1
Copy link
Contributor Author

lhutton1 commented Jul 18, 2023

Windows and MacOS builds are failing as they use cython==0.29.24 and cython==0.29.28 respectively, which are not compatible with the new noexcept keyword. This functionality was added in 0.29.31 (https://github.com/cython/cython/blob/master/CHANGES.rst#02931-2022-07-27). We could either upgrade the Windows and MacOS builds to use a newer version of cython (I'm not too sure yet how to get later versions in conda), or we can constrain the version in main CI to >=0.29.31, <= 0.29.36.

lhutton1 added a commit to lhutton1/tvm that referenced this pull request Jul 18, 2023
Cython 3.0.0 was recently released, but it is incompatible with the
current .pxi definitions in python/tvm/_ffi/_python. Pinning
the cython version until a working fix is created.

Posting this PR as an alternative to
apache#15346.

Change-Id: Id817aea375e1ed84c807c265ca4cc42c1757bca0
@Mousius
Copy link
Member

Mousius commented Jul 18, 2023

My guess would be that because the Conda build uses 3.7 of Python, it isn't receiving newer builds of Cython.

- python=3.7 # or 3.8. See https://github.com/apache/tvm/issues/8577 for more details on >= 3.9

That may be quite concerning given 3.7 just passed end of life (https://devguide.python.org/versions/).

@tqchen
Copy link
Member

tqchen commented Jul 18, 2023

We can remove the 3.7 here from tehe build env

@junrushao
Copy link
Member

Let's get this PR merged instead!

@lhutton1
Copy link
Contributor Author

lhutton1 commented Jul 19, 2023

After updating the python version to 3.8, the same issues mentioned in #15346 (comment) seem to persist

For MacOS (I didn't check windows yet), it seems there are updated cython packages available on this channel https://repo.anaconda.com/pkgs/main/osx-64/ for python 3.8, but conda seems to prefer fetching packages from a different outdated channel (https://conda.anaconda.org/anaconda/osx-64/), I'm a little bit lost here..

lhutton1 added 4 commits July 21, 2023 14:44
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:
scipy/scipy#17234 (comment).

Change-Id: Ic252ddfb4262a3b0fffe93c5ca4b9729bf167e05
Upgrades the python version from 3.7 to 3.8 to use newer versions
of cython.

Change-Id: Id5e280eebaae1d367774ad0952234a1458cc1c33
Change-Id: I67c8342dc963b4b8e955aede9282551297be0c14
Change-Id: I01b60b5ff5e6ba8df4e1afdd5ff931ae7dd77775
@lhutton1
Copy link
Contributor Author

lhutton1 commented Jul 25, 2023

I've tried reproducing the conda environment used for MacOS locally with this patch checked out, although I've been unable to recreate the same failure. The latest version of cython 3.0.0 is successfully installed when running: conda env create --file conda/build-environment.yaml on an M1 Mac.

@tqchen
Copy link
Member

tqchen commented Aug 3, 2023

#15469 likely supersedes this. We can still work to upgrade the python conda versions to 3.8 or later

@lhutton1
Copy link
Contributor Author

lhutton1 commented Aug 3, 2023

Closing in favour of #15469, thanks @tqchen! Let's pull the conda python version upgrade into a separate PR

@lhutton1 lhutton1 closed this Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants