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

[python] Start supporting Python 3.10 #4893

Merged
merged 16 commits into from
Feb 18, 2022
Merged

[python] Start supporting Python 3.10 #4893

merged 16 commits into from
Feb 18, 2022

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Dec 18, 2021

Python 3.10 was released 2021-10-04.
https://devguide.python.org/#branchstatus

Why enclose Python version in quotes: #3880 (comment).

...
Solving environment: ...working... failed                                                               
PackagesNotFoundError: The following packages are not available from current channels:
  - python=3.1
...

WIP Due to

  • dask=2021.9.1 isn't compatible with Python 3.10;
    conda install -q -y -n $CONDA_ENV cloudpickle "dask=2021.9.1" "distributed=2021.9.1" joblib matplotlib numpy pandas psutil pytest scikit-learn scipy
  • building numpy and other dependencies from sources takes more than 30 minutes.

@StrikerRUS StrikerRUS changed the title [python] Start supporting Python 3.10 [WIP][python] Start supporting Python 3.10 Dec 18, 2021
@StrikerRUS
Copy link
Collaborator Author

advanced_example.py fails during executing on Linux regular CI job with Python 3.10 with the following error

Traceback (most recent call last):
  File "/__w/1/s/examples/python-guide/advanced_example.py", line 8, in <module>
    from sklearn.metrics import mean_squared_error
  File "/opt/miniforge/envs/test-env/lib/python3.10/site-packages/sklearn/__init__.py", line 83, in <module>
    from .utils._show_versions import show_versions
  File "/opt/miniforge/envs/test-env/lib/python3.10/site-packages/sklearn/utils/_show_versions.py", line 12, in <module>
    from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: dlopen: cannot load any more object with static TLS

This fail occurs due to compatibility problems with old Ubuntu 14.04 (old glibc actually) and OpenMP.
Related discussions and workarounds (all about upgrading software versions):

This error shouldn't occur with glibc >=2.21: https://sourceware.org/bugzilla/show_bug.cgi?id=17620.

@StrikerRUS
Copy link
Collaborator Author

It's getting harder and harder to support a such old version of Ubuntu (14.04) ...

@jameslamb
Copy link
Collaborator

It's getting harder and harder to support a such old version of Ubuntu (14.04)

Thanks for the additional research and issues you linked to! conda-forge/conda-forge.github.io#1551 is especially troubling 😞

According to https://ubuntu.com/about/release-cycle#ubuntu-kernel-release-cycle, Ubuntu 14.04 was first released in 2014, starting in 2019 it went into "only receiving security patches" mode, and it will be in that mode until 2024.

image

Given all that, I'd like to try to keep supporting it, but also acknowledge that we have a limited amount of time and energy to spend on maintaining this project.

Since the issues you linked are all related to OpenMP, what do you think about switching Ubuntu 14.04 builds to using --nomp?

('nomp', None, 'Compile version without OpenMP support'),

Maybe that could be a manageable compromise between "spend time trying to get this working on Ubuntu 14.04" and "stop testing on Ubuntu 14.04 entirely".

@StrikerRUS
Copy link
Collaborator Author

Since the issues you linked are all related to OpenMP, what do you think about switching Ubuntu 14.04 builds to using --nomp?

A lot of CI jobs with Ubuntu 14.04 are used to produce public artifacts

LightGBM/.vsts-ci.yml

Lines 72 to 73 in 2d1caf1

- task: PublishBuildArtifacts@1
condition: and(succeeded(), in(variables['TASK'], 'regular', 'sdist', 'bdist', 'swig'), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))

I don't think it's a good idea to build artifacts with --nomp flag...

I'm thinking about to simply re-arange Python versions there because it seems that only 3.10 one has compatibility problems.

@@ -35,17 +35,18 @@ jobs:
matrix:
regular:
TASK: regular
PYTHON_VERSION: '3.9'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried to use different Python versions for the same TASK in Linux and Linux_latest jobs. The same is true for macOS configurations on Azure Pipelines and GitHub Actions.

@StrikerRUS StrikerRUS changed the title [WIP][python] Start supporting Python 3.10 [python] Start supporting Python 3.10 Feb 16, 2022
@StrikerRUS StrikerRUS marked this pull request as ready for review February 16, 2022 22:37
@StrikerRUS
Copy link
Collaborator Author

I believe this PR is ready for review.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

excellent! thanks for doing this! And for the explanation about why it is necessary to add quotes in the config 😂

"3.7" {$env:MINICONDA = "C:\Miniconda37-x64"}
default {$env:MINICONDA = "C:\Miniconda37-x64"}
}
$env:MINICONDA = "C:\Miniconda3-x64"
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh! haha I never noticed that these two values were the same.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants