Skip to content

CI Pin Cython<3 in some builds due to observed regressions #27266

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

Merged
merged 9 commits into from
Sep 7, 2023

Conversation

jjerphan
Copy link
Member

@jjerphan jjerphan commented Sep 2, 2023

Reference Issues/PRs

Related to #27086.

What does this implement/fix? Explain your changes.

This forces using Cython<3 for everything except pylatest CI checks.

Any other comments?

Do you think that the updates to the environment specifications are adequate?

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 066ad2a. Link to the linter CI: here

@jjerphan jjerphan marked this pull request as ready for review September 2, 2023 09:39
[scipy-dev] [pypy] [azure parallel]

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@betatim
Copy link
Member

betatim commented Sep 4, 2023

I was trying to work out if 1.3.0 was built with cython 3 or not. I think the answer is that 1.3.0 was not built with cython 3 because 1.3.0 was released on 30th June and cython 3.0 was released on 17th July.

If this is true then I'd wait with merging this until (a reasonable amount) before the next release. That way we can see if the regression(s) get fixed in cython/work-around'ed in scikit-learn. That way we have a chance of not having to go back to an older version.

What do you think?

@jjerphan
Copy link
Member Author

jjerphan commented Sep 4, 2023

I was trying to work out if 1.3.0 was built with cython 3 or not. I think the answer is that 1.3.0 was not built with cython 3 because 1.3.0 was released on 30th June and cython 3.0 was released on 17th July.

Yes, that's it. One can check against the feedstock logs (for instance, this one).

If this is true then I'd wait with merging this until (a reasonable amount) before the next release. That way we can see if the regression(s) get fixed in cython/work-around'ed in scikit-learn. That way we have a chance of not having to go back to an older version.

What do you think?

I am OK with either waiting or merging and then reverting this PR.

@betatim
Copy link
Member

betatim commented Sep 4, 2023

I am OK with either waiting or merging and then reverting this PR.

Ok, both sound good. Maybe the only unknown is how we keep track of the task of reverting/merging :D

@lorentzenchr lorentzenchr added this to the 1.4 milestone Sep 4, 2023
@lesteve
Copy link
Member

lesteve commented Sep 5, 2023

I am gently hijacking this PR to double-check that indeed Cython 3 is the main cause of the CircleCI builds timing out as mentioned in #27086 (comment)

Edit: it seems like Cython 3 is indeed the main cause since on the doc build, examples/ensemble/plot_forest_hist_grad_boosting_comparison.py takes ~1 minute instead of ~8 minutes on main. From this build log:

/examples/ensemble/plot_forest_hist_grad_boosting_comparison.py:                            55.97 sec

@jjerphan
Copy link
Member Author

jjerphan commented Sep 5, 2023

Feel free to pursue this PR.

Thinking again, I think we have no benefit in using Cython 3 so I think we better use Cython < 3 generally for now.

@lesteve
Copy link
Member

lesteve commented Sep 5, 2023

Thinking again, I think we have no benefit in using Cython 3 so I think we better use Cython < 3 generally for now.

Yeah I was wondering about that too. The consensus at the meeting today was that it is better to keep some builds with cython>=3 to keep testing it. On the other hand we are testing Cython 3 with the scipy-dev build so 🤷

The main thing I am wondering about is about whether we need to change pyproject.toml? It feels like it complicates the setup since in some CI builds, the installation of scikit-learn will change the Cython version compared to the lock file, which can be confusing. This happens if scikit-learn is installed with pip install -e . as in the case if DISTRIB == 'conda-pip-latest' i.e. the pylatest_pip_openblas_pandas build.

FYI (we were wondering about this at the meeting): pip install --no-build-isolation is not going to care about the versions in pyproject.toml, it will try to use what is already installed in the current environment.

@lesteve
Copy link
Member

lesteve commented Sep 6, 2023

I removed the pyproject.toml related changes making this PR more of a CI one to speed-up some builds, especially the doc build.

I would say/hope that there is a good chance that Cython 3 fixes regressions before the release of scikit-learn 1.4. If it's not the case, I guess we can revisit changing pyproject.toml.

pyproject.toml Outdated
@@ -3,8 +3,6 @@
requires = [
"setuptools",
"wheel",
"Cython>=0.29.33",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to keep at least "Cython"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops indeed

@lesteve lesteve changed the title MAINT Pin Cython<3 due to observed regressions CI Pin Cython<3 in some builds due to observed regressions Sep 6, 2023
Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (+1 to not touch pyproject.toml for now)

@lesteve
Copy link
Member

lesteve commented Sep 7, 2023

Merging this one, thanks!

There is an approval and I think that other comments amounts to another +1. Further improvements/tweaks can be done in a separate PR.

@lesteve lesteve merged commit dbdb66e into scikit-learn:main Sep 7, 2023
@jjerphan jjerphan deleted the maint/pin-cython-3 branch September 7, 2023 08:23
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 18, 2023
…learn#27266)

Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
jeremiedbb pushed a commit that referenced this pull request Sep 20, 2023
Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
…learn#27266)

Co-authored-by: Loïc Estève <loic.esteve@ymail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants